1 Proposal

1.1 Original grant proposal for Census tract level analyses

1.1.1 Objective 1: Socio-spatial inequalities in urban interventions:

  • To test if urban interventions tend to be located in low SES neighborhoods (H1a); we will run the following model: \[Log(𝔼(UI_{𝑖} \mid X_{𝑖})) = \alpha + \beta_{1} * SES_{𝑖}\] a Poisson regression model with \(UI\) = the number of Urban Interventions between 2016 and 2021, \(SES\) = the socio-economic status of the census track at 2016.
  • To test the reduction in socio-economic inequalities in urban conditions (e.g. length and type of bicycle lanes, NDVI) between 2006 and 2020 (H1b), we will run the following model: \[𝔼(UC_{ij} \mid X_{ij}) = \beta_{0j} + \beta_{1j} ∗ SES + \beta_{2j} ∗ Time + \beta_{3j} ∗ SES ∗ Time + \epsilon_{ij}\] a multilevel linear model with \(UC\) = the Urban condition, \(SES\) = the socio-economic status of the census track.

1.1.2 Objective 2: Examining causal pathways and directionality of intervention/gentrification relation:

  • To test if urban interventions occur before gentrification or if gentrification occurs before the implementation of new urban interventions, we will run two models : (1) \[Logit(𝔼(G_{i} \mid X_{i})) = \alpha + \beta_{1} ∗ UI_{i} + + \beta_{2} ∗ PG_{i} + \beta ∗ X_{control_{i}}\] a logistic regression model among low SES census tracts (2006) with \(G\) = Gentrification between 2006 and 2016, \(UI\) = the number of Urban Interventions between 2001 and 2006, and \(PG\) = SES status 2006; and (2) \[Logit(𝔼(UI_{i} \mid X_{i})) = \alpha + \beta_{1} ∗ G_{i} + \beta_{2} ∗ UC_{i} + \beta ∗ X_{control_{i}}\] a Poisson regression model, with \(UI\) = the number of Urban Interventions between 2016 and 2023, \(G\) = Gentrification between 2006 and 2016, and \(UC\) = Urban Conditions in 2016.

1.2 Paper objective

We focus on obj #1: are urban interventions tend to be located in low SES neighborhoods. Here, the urban interventions considered are bike lanes and canopy/tree coverage and low SES ~ high Pampalon deprivation index. In a second step, we will look at the variations of UI and SES and their association.

Data extraction and pre-analyses for the paper looking at BEI and equity. BEI comprise bike lanes and canopy changes while equity is measured through Pampalon deprivation index. (Partially adapted from original work on BEI bike lanes – see bike_lane_stats.R and ReadMe.md.)

Paper is available here.

General processing steps:

  • Get CT 2016 boundaries (from Cancensus API)
  • Get BEI interventions (canopy / bike lanes) for the selected years (2011 / 2015 / 2016 / 2019)
  • Compute changes between years
    • for the original CT boundaries
    • for buffered CTs (250 / 500 / 750m)

In a second phase, these BEI changes will be linked to Pampalon index for 2016 (and 2011 ?)

UPDATE 2021-12-02 Following discussion with @Yan, add normalized bike line changes:

  • by CT/buffer area
  • by street length within CT/buffer

UPDATE 2021-12-08 Following discussion with @Yan

  • Keep only normalized variation of bike lane length
  • Reverse relation: BEI metric = f(Equity metric (Pampalon / gentrification))
  • Display association at baseline, then add delta over time
  • Canopy : distinguish between high and low canopy

2 Built Environment Intervention Extraction

2.1 Bike lane changes

We use data categorized by Philippe Apparicio’s team who manually identified bike lanes for each census year since 1991. For this study, we limit ourselves to 2016 and 2011 census years.

On top of the original CT boundaries, three levels of buffer have been applied to the CT – 250m, 500m & 750m. Then the same series of processing steps (see above) have been applied to the buffers.

# Bike lanes, from Ph. Apparicio
reseau <- st_read(dsn="data/ReseauCyclableFinal.gdb", layer = "Reseau") # Already in NAD83 / MTM zone 8
## Reading layer `Reseau' from data source 
##   `/Users/benoit/WORKSPACE/gentrification_BEI_equity/data/ReseauCyclableFinal.gdb' 
##   using driver `OpenFileGDB'
## Simple feature collection with 82166 features and 72 fields
## Geometry type: GEOMETRY
## Dimension:     XYZ, XYZM
## Bounding box:  xmin: 266985.5 ymin: 5029251 xmax: 320986.1 ymax: 5062652
## z_range:       zmin: 0 zmax: 43
## m_range:       mmin: 0 mmax: 43
## Projected CRS: NAD83 / MTM zone 8
bike_lane <- reseau %>%
  filter(An2016 == 1 | An2011 == 1) %>%
  select(IdRte, ClsRte, Zone, starts_with("An"), starts_with("Typo_")) %>%
  st_cast("MULTILINESTRING") # Get rid of a few MULTICURVE geometries

# CT boundaries for Montreal
CT16 <- get_census(dataset='CA16', regions=list(CMA='24462'), level='CT', geo_format = "sf") %>%
  filter(Type == "CT") %>%
  mutate(interact_aoi = CD_UID %in% c(2466, 2465, 2458)) %>% # Flag Montréal island, Laval and the South shore (Longueuil, St-Lambert, Brossard)
  st_transform(st_crs(bike_lane))
## Reading geo data from local cache.
CT11 <- get_census(dataset='CA11', regions=list(CMA='24462'), level='CT', geo_format = "sf") %>%
  filter(Type == "CT") %>%
  st_transform(st_crs(bike_lane))
## Reading geo data from local cache.
compute_bikelane_by_area <- function(sf_areas, year_fld, typo_fld) {
  # Compute length of bike lanes within each area.
  # --
  # Parameters:
  #   - sf_areas: sf class object defining the areas of interest, must have a GeoUID field
  #   - year_fld: field name specifying the year of interest, e.g. An2016
  #   - typo_fld: field name specifying the typology for the year of interest, e.g. Typo_2016
  
  year_fld <- enquo(year_fld)
  typo_fld <- enquo(typo_fld)
  
  # Compute intersection of bike lanes with areas
  bk <- bike_lane %>%
    filter(!!year_fld == 1) %>%
    st_intersection(sf_areas) %>%
    mutate(bike_lane_length = st_length(.)) %>%
    as.data.frame() %>%
    group_by(GeoUID, !!typo_fld) %>%
    summarise(bike_lane_length = sum(bike_lane_length)) %>%
    ungroup() %>%
    pivot_wider(names_from = !!typo_fld, names_prefix = "Bike_class", names_sort = TRUE,
                values_from = bike_lane_length, values_fill = units::set_units(0, m)) %>%
    mutate(Bike_lane_total = units::set_units(rowSums(select(., starts_with("Bike_class"))), m))
  
  # Merge back into original sf_areas
  bk <- sf_areas %>%
    left_join(bk)
  
  # Replace NA by 0, which occur in Bike_class length
  bk[is.na(bk)] <- 0
  
  return(bk)
}

compute_streetlength_by_area <- function(sf_areas) {
  # Compute length of streets within each area.
  # --
  # Parameters:
  #   - sf_areas: sf class object defining the areas of interest, must have a GeoUID field

  # Compute intersection of streets with areas
  bk <- reseau  %>%
    st_cast("MULTILINESTRING") %>% # Get rid of a few MULTICURVE geometries
    st_intersection(sf_areas) %>%
    mutate(street_length = st_length(.)) %>%
    as.data.frame() %>%
    group_by(GeoUID) %>%
    summarise(street_length = sum(street_length)) %>%
    ungroup()
  
  # Merge back into original sf_areas
  bk <- sf_areas %>%
    mutate(shape_area_km2 = units::set_units(st_area(.), 'km^2')) %>%
    left_join(bk)
  
  # Replace NA by 0
  bk[is.na(bk)] <- 0
  
  return(bk)
}


# Compute year 2016 and year 2011 bike lanes within 2016 CTs
# NB: contrary to the original work, we keep the same area of reference, i.e. 2016
bike_lane_by_CT16 <- compute_bikelane_by_area(CT16, An2016, Typo_2016)
bike_lane_by_CT11 <- compute_bikelane_by_area(CT16, An2011, Typo_2011)

# Compute buffers, with 3 radii and for each census year
radii <- c(250, 500, 750)

buf_CT16 <- lapply(radii, st_buffer, x=CT16)
names(buf_CT16) <- lapply(radii, function(b) {paste0("buf", b)})

# Compute bike length for each buffer/census year
buf_CT16_w_bike_length <- lapply(buf_CT16, compute_bikelane_by_area, year_fld=An2016, typo_fld=Typo_2016)
names(buf_CT16_w_bike_length) <- lapply(radii, function(b) {paste0("buf", b)})
buf_CT16_w_bike_length$original <- bike_lane_by_CT16

buf_CT11_w_bike_length <- lapply(buf_CT16, compute_bikelane_by_area, year_fld=An2011, typo_fld=Typo_2011)
names(buf_CT11_w_bike_length) <- lapply(radii, function(b) {paste0("buf", b)})
buf_CT11_w_bike_length$original <- bike_lane_by_CT11

# Compute total street length within CT/buffer
street_length_by_CT16 <- compute_streetlength_by_area(CT16)
buf_CT16_street_length <- lapply(buf_CT16, compute_streetlength_by_area)
names(buf_CT16_street_length) <- lapply(radii, function(b) {paste0("buf", b)})
buf_CT16_street_length$original <- street_length_by_CT16

# Reorganize data to have all data in one dataframe
bike_lane_changes <- CT16 %>%
  left_join(select(as.data.frame(buf_CT16_street_length$original), GeoUID, street_length, shape_area_km2), by="GeoUID") %>%
  left_join(select(as.data.frame(buf_CT16_street_length$buf250), GeoUID, street_length, shape_area_km2), by="GeoUID", suffix=c(".ct", ".b250")) %>%
  left_join(select(as.data.frame(buf_CT16_street_length$buf500), GeoUID, street_length, shape_area_km2), by="GeoUID") %>%
  left_join(select(as.data.frame(buf_CT16_street_length$buf750), GeoUID, street_length, shape_area_km2), by="GeoUID", suffix=c(".b500", ".b750")) %>%
  left_join(select(as.data.frame(buf_CT16_w_bike_length$original), GeoUID, starts_with("Bike_")), by="GeoUID") %>%
  left_join(select(as.data.frame(buf_CT11_w_bike_length$original), GeoUID, starts_with("Bike_")), by="GeoUID", suffix=c(".2016ct", ".2011ct")) %>%
  left_join(select(as.data.frame(buf_CT16_w_bike_length$buf250), GeoUID, starts_with("Bike_")), by="GeoUID") %>%
  left_join(select(as.data.frame(buf_CT11_w_bike_length$buf250), GeoUID, starts_with("Bike_")), by="GeoUID", suffix=c(".2016b250", ".2011b250")) %>%
  left_join(select(as.data.frame(buf_CT16_w_bike_length$buf500), GeoUID, starts_with("Bike_")), by="GeoUID") %>%
  left_join(select(as.data.frame(buf_CT11_w_bike_length$buf500), GeoUID, starts_with("Bike_")), by="GeoUID", suffix=c(".2016b500", ".2011b500")) %>%
  left_join(select(as.data.frame(buf_CT16_w_bike_length$buf750), GeoUID, starts_with("Bike_")), by="GeoUID") %>%
  left_join(select(as.data.frame(buf_CT11_w_bike_length$buf750), GeoUID, starts_with("Bike_")), by="GeoUID", suffix=c(".2016b750", ".2011b750"))

# Compute ratio of bike lane vs street length
bike_lane_changes <- bike_lane_changes %>%
  mutate(Bike_lane.by.street.2011ct = 100 * Bike_lane_total.2011ct / street_length.ct,
         Bike_lane.by.street.2011b250 = 100 * Bike_lane_total.2011b250 / street_length.b250,
         Bike_lane.by.street.2011b500 = 100 * Bike_lane_total.2011b500 / street_length.b500,
         Bike_lane.by.street.2011b750 = 100 * Bike_lane_total.2011b750 / street_length.b750,
         Bike_lane.by.street.2016ct = 100 * Bike_lane_total.2016ct / street_length.ct,
         Bike_lane.by.street.2016b250 = 100 * Bike_lane_total.2016b250 / street_length.b250,
         Bike_lane.by.street.2016b500 = 100 * Bike_lane_total.2016b500 / street_length.b500,
         Bike_lane.by.street.2016b750 = 100 * Bike_lane_total.2016b750 / street_length.b750)

# Compute change between 2011 and 2016 (only for total bike lane length)
bike_lane_changes <- bike_lane_changes %>%
  mutate(Bike_lane_diff.2011.2016ct = Bike_lane_total.2016ct - Bike_lane_total.2011ct,
         Bike_lane_diff.2011.2016b250 = Bike_lane_total.2016b250 - Bike_lane_total.2011b250,
         Bike_lane_diff.2011.2016b500 = Bike_lane_total.2016b500 - Bike_lane_total.2011b500,
         Bike_lane_diff.2011.2016b750 = Bike_lane_total.2016b750 - Bike_lane_total.2011b750)

# Normalize bike lane change by (i) street length and (ii) area
bike_lane_changes <- bike_lane_changes %>%
  mutate(Bike_lane_diff.by.street.2011.2016ct = 100 * Bike_lane_diff.2011.2016ct / street_length.ct,
         Bike_lane_diff.by.street.2011.2016b250 = 100 * Bike_lane_diff.2011.2016b250 / street_length.b250,
         Bike_lane_diff.by.street.2011.2016b500 = 100 * Bike_lane_diff.2011.2016b500 / street_length.b500,
         Bike_lane_diff.by.street.2011.2016b750 = 100 * Bike_lane_diff.2011.2016b750 / street_length.b750,
         Bike_lane_diff.by.area.2011.2016ct = Bike_lane_diff.2011.2016ct / shape_area_km2.ct,
         Bike_lane_diff.by.area.2011.2016b250 = Bike_lane_diff.2011.2016b250 / shape_area_km2.b250,
         Bike_lane_diff.by.area.2011.2016b500 = Bike_lane_diff.2011.2016b500 / shape_area_km2.b500,
         Bike_lane_diff.by.area.2011.2016b750 = Bike_lane_diff.2011.2016b750 / shape_area_km2.b750)

# Save results
st_write(bike_lane_changes, dsn = "data/bike_length_changes.gpkg", delete_layer = TRUE)
## Deleting layer `bike_length_changes' using driver `GPKG'
## Writing layer `bike_length_changes' to data source 
##   `data/bike_length_changes.gpkg' using driver `GPKG'
## Writing 970 features with 104 fields and geometry type Multi Polygon.
# Clean up
rm(buf_CT16)
rm(bike_lane_by_CT11, bike_lane_by_CT16)
rm(buf_CT11_w_bike_length, buf_CT16_w_bike_length)
rm(street_length_by_CT16, buf_CT16_street_length)

2.1.1 Illustration of bike lane metrics

Check output for one specific dataset (Census tracts 2016, no buffer)

2.1.1.1 Raw length

Bike lane length in 2016 within CTs, measured in meters

ggplot() +
   geom_sf(data=filter(bike_lane_changes, interact_aoi), mapping = aes(fill=as.numeric(Bike_lane_total.2016ct)), lwd=0) +
  scale_fill_continuous(name = "Total length (m)")+ 
  labs(title = "Length of bike lanes within 2016 CTs", subtitle = "(INTERACT study area || for control only)")

2.1.1.2 Absolute length change

Absolute bike lane length change between 2011 and 2016, in meters

ggplot() +
   geom_sf(data=filter(bike_lane_changes, interact_aoi), mapping = aes(fill=as.numeric(Bike_lane_diff.2011.2016ct)), lwd=0) +
  scale_fill_gradient2(name = "Length (m)")+ 
  labs(title = "Changes in bike lane between 2011 and 2016", subtitle = "(INTERACT study area || CT level || for control only)")

2.1.1.3 Normalized length change (by street)

Relative bike lane length change between 2011 and 2016, normalized by street length within CT in 2016, expressed in %

\[Variation = \frac{Bike Lane_{2016}}{Street Length_{2016}} - \frac{Bike Lane_{2011}}{Street Length_{2016}}\]

ggplot() +
   geom_sf(data=filter(bike_lane_changes, interact_aoi), mapping = aes(fill=as.numeric(Bike_lane_diff.by.street.2011.2016ct)), lwd=0) +
  scale_fill_gradient2(name = "Variation (%)")+ 
  labs(title = "Changes in bike lane between 2011 and 2016, normalized by street", subtitle = "(INTERACT study area || CT level || for control only)")

2.1.1.4 Normalized length change (by area)

Relative bike lane length change between 2011 and 2016, normalized by CT area, expressed in \(\frac{km}{km^{2}}\)

\[Ratio = \frac{Bike Lane_{2016}}{CT Area_{2016}} - \frac{Bike Lane_{2011}}{CT Area_{2016}}\]

ggplot() +
   geom_sf(data=filter(bike_lane_changes, interact_aoi), mapping = aes(fill=as.numeric(Bike_lane_diff.by.area.2011.2016ct)), lwd=0) +
  scale_fill_gradient2(name = "Ratio (1/km)")+ 
  labs(title = "Changes in bike lane between 2011 and 2016, normalized by area", subtitle = "(INTERACT study area || CT level || for control only)")

2.1.1.5 Normalized length change (by street) NEW

After some discussion with Yan, we envision using a relative bike lane length ratio change between 2011 and 2016, normalized by the ratio in 2011, expressed in %

\[Variation = \frac{\frac{Bike Lane_{2016}}{Street Length_{2016}} - \frac{Bike Lane_{2011}}{Street Length_{2016}}}{\frac{Bike Lane_{2011}}{Street Length_{2016}}} = \frac{Bike Lane_{2016} - Bike Lane_{2011}}{Bike Lane_{2011}}\]

Problem: all CT with no bike lane in 2011 get a missing data, contrary to the original metric, which measured the absolute variation of the ratio of bike lane to street length.

.bike_lane_changes <- bike_lane_changes %>%
  mutate(Bike_lane_diff.by.street.relative.2011.2016ct = Bike_lane_diff.by.street.2011.2016ct / (Bike_lane_total.2011ct / street_length.ct))

ggplot() +
   geom_sf(data=filter(.bike_lane_changes, interact_aoi), mapping = aes(fill=as.numeric(Bike_lane_diff.by.street.relative.2011.2016ct)), lwd=0) +
  scale_fill_gradient2(name = "Ratio")+ 
  labs(title = "Changes in bike lane ratio between 2011 and 2016, normalized by ratio in 2011", subtitle = "(INTERACT study area || CT level || for control only)")

2.1.2 Basic stats on each layer

2.1.2.1 Census Tracts

# CT level
ggplot(bike_lane_changes) +
  geom_histogram(aes(as.numeric(Bike_lane_diff.2011.2016ct)), binwidth = 250) + 
  xlab("Difference of bike lane length between 2016 and 2011 | CT level")

summary(bike_lane_changes$Bike_lane_diff.2011.2016ct)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
## -1377.7     0.0     0.0   262.1   189.7 14463.8
ggplot(bike_lane_changes) +
  geom_histogram(aes(as.numeric(Bike_lane_diff.by.street.2011.2016ct))) + 
  xlab("Difference of bike lane length between 2016 and 2011, normalized by street")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## Warning: Removed 252 rows containing non-finite values (stat_bin).

summary(bike_lane_changes$Bike_lane_diff.by.street.2011.2016ct)
##     Min.  1st Qu.   Median     Mean  3rd Qu.     Max.     NA's 
## -100.000    0.000    0.000    3.665    4.496  100.000      252
ggplot(bike_lane_changes) +
  geom_histogram(aes(as.numeric(Bike_lane_diff.by.area.2011.2016ct))) + 
  xlab("Difference of bike lane length between 2016 and 2011, normalized by area")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

summary(bike_lane_changes$Bike_lane_diff.by.area.2011.2016ct)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
## -1.1474  0.0000  0.0000  0.4237  0.1764  8.9852
ggplot(.bike_lane_changes) +
  geom_histogram(aes(as.numeric(Bike_lane_diff.by.street.relative.2011.2016ct))) + 
  xlab("Difference of bike lane length between 2016 and 2011, normalized by ratio in 2011")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## Warning: Removed 461 rows containing non-finite values (stat_bin).

summary(.bike_lane_changes$Bike_lane_diff.by.street.relative.2011.2016ct)
##      Min.   1st Qu.    Median      Mean   3rd Qu.      Max.      NA's 
## -100.0000    0.0000    0.2199       Inf  102.7796       Inf       367

2.1.2.2 Buffers 250m

# buf250 level
ggplot(bike_lane_changes) +
  geom_histogram(aes(as.numeric(Bike_lane_diff.2011.2016b250)), binwidth = 250) + 
  xlab("Difference of bike lane length between 2016 and 2011 | buf 250m")

summary(bike_lane_changes$Bike_lane_diff.2011.2016b250)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
## -3452.5     0.0     0.0   646.7   933.8 20786.8
ggplot(bike_lane_changes) +
  geom_histogram(aes(as.numeric(Bike_lane_diff.by.street.2011.2016b250))) + 
  xlab("Difference of bike lane length between 2016 and 2011, normalized by street")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## Warning: Removed 233 rows containing non-finite values (stat_bin).

summary(bike_lane_changes$Bike_lane_diff.by.street.2011.2016b250)
##     Min.  1st Qu.   Median     Mean  3rd Qu.     Max.     NA's 
## -38.5802   0.0000   0.8538   3.3168   4.9043  56.6588      233
ggplot(bike_lane_changes) +
  geom_histogram(aes(as.numeric(Bike_lane_diff.by.area.2011.2016b250))) + 
  xlab("Difference of bike lane length between 2016 and 2011, normalized by area")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

summary(bike_lane_changes$Bike_lane_diff.by.area.2011.2016b250)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
## -1.4622  0.0000  0.0000  0.4001  0.4306  6.2156

2.1.2.3 Buffers 500m

# buf500 level
ggplot(bike_lane_changes) +
  geom_histogram(aes(as.numeric(Bike_lane_diff.2011.2016b500)), binwidth = 250) + 
  xlab("Difference of bike lane length between 2016 and 2011 | buf 500m")

summary(bike_lane_changes$Bike_lane_diff.2011.2016b250)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
## -3452.5     0.0     0.0   646.7   933.8 20786.8
ggplot(bike_lane_changes) +
  geom_histogram(aes(as.numeric(Bike_lane_diff.by.street.2011.2016b500))) + 
  xlab("Difference of bike lane length between 2016 and 2011, normalized by street")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## Warning: Removed 229 rows containing non-finite values (stat_bin).

summary(bike_lane_changes$Bike_lane_diff.by.street.2011.2016b500)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
## -26.891   0.000   1.385   3.298   5.323  22.121     229
ggplot(bike_lane_changes) +
  geom_histogram(aes(as.numeric(Bike_lane_diff.by.area.2011.2016b500))) + 
  xlab("Difference of bike lane length between 2016 and 2011, normalized by area")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

summary(bike_lane_changes$Bike_lane_diff.by.area.2011.2016b500)
##     Min.  1st Qu.   Median     Mean  3rd Qu.     Max. 
## -0.94397  0.00000  0.03393  0.38745  0.49370  4.00417

2.1.2.4 Buffers 750m

# buf750 level
ggplot(bike_lane_changes) +
  geom_histogram(aes(as.numeric(Bike_lane_diff.2011.2016b750)), binwidth = 250) + 
  xlab("Difference of bike lane length between 2016 and 2011 | buf 750m")

summary(bike_lane_changes$Bike_lane_diff.2011.2016b750)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
## -3697.5     0.0   578.6  1842.2  2928.6 29325.1
ggplot(bike_lane_changes) +
  geom_histogram(aes(as.numeric(Bike_lane_diff.by.street.2011.2016b750))) + 
  xlab("Difference of bike lane length between 2016 and 2011, normalized by street")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## Warning: Removed 222 rows containing non-finite values (stat_bin).

summary(bike_lane_changes$Bike_lane_diff.by.street.2011.2016b750)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
## -4.7579  0.1418  1.7793  3.2961  5.2054 22.5448     222
ggplot(bike_lane_changes) +
  geom_histogram(aes(as.numeric(Bike_lane_diff.by.area.2011.2016b750))) + 
  xlab("Difference of bike lane length between 2016 and 2011, normalized by area")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

summary(bike_lane_changes$Bike_lane_diff.by.area.2011.2016b750)
##     Min.  1st Qu.   Median     Mean  3rd Qu.     Max. 
## -0.59760  0.00000  0.07793  0.38166  0.53774  3.95463

2.2 Canopy changes

Canopy changes is based on data produced by CMM, using multispectral aerial imagery and lidar. In order to sync the observations with the census years, we focus on 2011 and 2019 with one extra observation point in 2015.

The processing steps are similar to the ones for the bike lanes:

  • Import the raster for each of the 3 years
  • Compute proportion of canopy within each area level (CT and buffers) for the 3 years
# Codes du raster "espace vert"
# 0. No data (hors CMM)
# 1. NDVI < 0,3 et MNH < 3,0m = Minéral bas (route, stationnement, etc.)
# 2. NDVI < 0,3 et MNH ≥ 3,0m = Minéral haut (constructions)
# 3. NDVI ≥ 0,3 et MNH < 3,0m = Végétal bas (culture, gazon, etc.)
# 4. NDVI ≥ 0,3 et MNH ≥ 3,0m = Végétal haut (canopée)
# 5. Aquatique

# Load rasters into pg database for further processing
system('psql -d xgentrif_bei -c "CREATE EXTENSION IF NOT EXISTS postgis"')
system('psql -d xgentrif_bei -c "CREATE EXTENSION IF NOT EXISTS postgis_raster"')

if (nrow(dbGetQuery(con_bei, "SELECT 1 test WHERE to_regclass('canopee2019') IS NOT NULL;")) == 0) {
  system("raster2pgsql -s 32188 -I -C -M data/canopy/2019/*.tif -F -t 1000x1000 canopee2019 | psql -d xgentrif_bei", intern = TRUE)
} else { message("PG Raster 'canopee2019' already imported") }
## PG Raster 'canopee2019' already imported
if (nrow(dbGetQuery(con_bei, "SELECT 1 test WHERE to_regclass('canopee2017') IS NOT NULL;")) == 0) {
  system("raster2pgsql -s 32188 -I -C -M data/canopy/2017/*.tif -F -t 1000x1000 canopee2017 | psql -d xgentrif_bei", intern = TRUE)
} else { message("PG Raster 'canopee2017' already imported") }
## PG Raster 'canopee2017' already imported
if (nrow(dbGetQuery(con_bei, "SELECT 1 test WHERE to_regclass('canopee2015') IS NOT NULL;")) == 0) {
  system("raster2pgsql -s 32188 -I -C -M data/canopy/2015/*.tif -F -t 1000x1000 canopee2015 | psql -d xgentrif_bei", intern = TRUE)
} else { message("PG Raster 'canopee2015' already imported") }
## PG Raster 'canopee2015' already imported
if (nrow(dbGetQuery(con_bei, "SELECT 1 test WHERE to_regclass('canopee2011') IS NOT NULL;")) == 0) {
  system("raster2pgsql -s 32188 -I -C -M data/canopy/2011/*.tif -F -t 1000x1000 canopee2011 | psql -d xgentrif_bei", intern = TRUE)
} else { message("PG Raster 'canopee2011' already imported") }
## PG Raster 'canopee2011' already imported
# Resample to 10m as the original rasters have a 1m resolution, which is too high to allow for a swift processing
if (nrow(dbGetQuery(con_bei, "SELECT 1 test WHERE to_regclass('canopee2019_10m') IS NOT NULL;")) == 0) {
  system("gdal_translate -of GTiff PG:\"host=localhost dbname=xgentrif_bei table=canopee2019 mode=2\" -r mode -tr 10 10 data/canopy/canopee2019_10m.tif")
  system("raster2pgsql -s 32188 -I -C -M data/canopy/canopee2019_10m.tif -F -t 100x100 canopee2019_10m | psql -d xgentrif_bei")
} else { message("PG Raster 'canopee2019_10m' already imported") }
## PG Raster 'canopee2019_10m' already imported
if (nrow(dbGetQuery(con_bei, "SELECT 1 test WHERE to_regclass('canopee2017_10m') IS NOT NULL;")) == 0) {
  system("gdal_translate -of GTiff PG:\"host=localhost dbname=xgentrif_bei table=canopee2017 mode=2\" -r mode -tr 10 10 data/canopy/canopee2017_10m.tif")
  system("raster2pgsql -s 32188 -I -C -M data/canopy/canopee2017_10m.tif -F -t 100x100 canopee2017_10m | psql -d xgentrif_bei")
} else { message("PG Raster 'canopee2017_10m' already imported") }
## PG Raster 'canopee2017_10m' already imported
if (nrow(dbGetQuery(con_bei, "SELECT 1 test WHERE to_regclass('canopee2015_10m') IS NOT NULL;")) == 0) {
  system("gdal_translate -of GTiff PG:\"host=localhost dbname=xgentrif_bei table=canopee2015 mode=2\" -r mode -tr 10 10 data/canopy/canopee2015_10m.tif")
  system("raster2pgsql -s 32188 -I -C -M data/canopy/canopee2015_10m.tif -F -t 100x100 canopee2015_10m | psql -d xgentrif_bei")
} else { message("PG Raster 'canopee2015_10m' already imported") }
## PG Raster 'canopee2015_10m' already imported
if (nrow(dbGetQuery(con_bei, "SELECT 1 test WHERE to_regclass('canopee2011_10m') IS NOT NULL;")) == 0) {
  system("gdal_translate -of GTiff PG:\"host=localhost dbname=xgentrif_bei table=canopee2011 mode=2\" -r mode -tr 10 10 data/canopy/canopee2011_10m.tif")
  system("raster2pgsql -s 32188 -I -C -M data/canopy/canopee2011_10m.tif -F -t 100x100 canopee2011_10m | psql -d xgentrif_bei")
} else { message("PG Raster 'canopee2011_10m' already imported") }
## PG Raster 'canopee2011_10m' already imported
# Push CT16 to pg
if (nrow(dbGetQuery(con_bei, "SELECT 1 test WHERE to_regclass('ct16') IS NOT NULL;")) == 0) {
  CT16 %>%
    st_transform(crs = 32188) %>%
    st_write(con_bei, "ct16",
             layer_options = c("OVERWRITE=yes", "LAUNDER=true", "SPATIAL_INDEX=gist", "GEOMETRY_NAME=geom"))
  system("psql -d xgentrif_bei -c 'CREATE INDEX ON  ct16 USING gist (geometry)'")
} else { message("PG Layer CT16 already imported") }
## PG Layer CT16 already imported

2.2.1 Extract % of green spaces at various scales

UPDATE 2021-12-08: following discussion with Yan, we decide to focus on extracting canopy years in sync with census years, i.e. 2011 and 2017, and 2015 as an intermediary year. (Previously, we were using the last available year, i.e. 2019), plus keep the option of looking high/low canopy separately

2.2.1.1 Census Tracts

WITH cnt19 AS (
    SELECT "GeoUID"
        ,(pvc).value, SUM((pvc).count) As total
    FROM (SELECT "GeoUID"
            ,ST_ValueCount(ST_Clip(rast, geometry)) As pvc
        FROM canopee2019_10m
        JOIN ct16 ON ST_Intersects(geometry, rast)
    ) As foo
    GROUP BY "GeoUID", (pvc).value
),
canopee19 AS (
    SELECT "GeoUID"
        ,round(100. * sum(total) FILTER (WHERE value in (3, 4)) / sum(total), 2) AS pct_esp_vert_2019
        ,round(100. * sum(total) FILTER (WHERE value = 3) / sum(total), 2) AS pct_esp_vert_low_2019
        ,round(100. * sum(total) FILTER (WHERE value = 4) / sum(total), 2) AS pct_esp_vert_high_2019
    FROM cnt19
    WHERE value > 0 -- discard no data, including postgis raster no data
    GROUP BY "GeoUID"
),
cnt17 AS (
    SELECT "GeoUID"
        ,(pvc).value, SUM((pvc).count) As total
    FROM (SELECT "GeoUID"
            ,ST_ValueCount(ST_Clip(rast, geometry)) As pvc
        FROM canopee2017_10m
        JOIN ct16 ON ST_Intersects(geometry, rast)
    ) As foo
    GROUP BY "GeoUID", (pvc).value
),
canopee17 AS (
    SELECT "GeoUID"
        ,round(100. * sum(total) FILTER (WHERE value in (3, 4)) / sum(total), 2) AS pct_esp_vert_2017
        ,round(100. * sum(total) FILTER (WHERE value = 3) / sum(total), 2) AS pct_esp_vert_low_2017
        ,round(100. * sum(total) FILTER (WHERE value = 4) / sum(total), 2) AS pct_esp_vert_high_2017
    FROM cnt17
    WHERE value > 0 -- discard no data, including postgis raster no data
    GROUP BY "GeoUID"
),
cnt15 AS (
    SELECT "GeoUID"
        ,(pvc).value, SUM((pvc).count) As total
    FROM (SELECT "GeoUID"
            ,ST_ValueCount(ST_Clip(rast, geometry)) As pvc
        FROM canopee2015_10m
        JOIN ct16 ON ST_Intersects(geometry, rast)
    ) As foo
    GROUP BY "GeoUID", (pvc).value
),
canopee15 AS (
    SELECT "GeoUID"
        ,round(100. * sum(total) FILTER (WHERE value in (3, 4)) / sum(total), 2) AS pct_esp_vert_2015
        ,round(100. * sum(total) FILTER (WHERE value = 3) / sum(total), 2) AS pct_esp_vert_low_2015
        ,round(100. * sum(total) FILTER (WHERE value = 4) / sum(total), 2) AS pct_esp_vert_high_2015
    FROM cnt15
    WHERE value > 0 -- discard no data, including postgis raster no data
    GROUP BY "GeoUID"
),
cnt11 AS (
    SELECT "GeoUID"
        ,(pvc).value, SUM((pvc).count) As total
    FROM (SELECT "GeoUID"
            ,ST_ValueCount(ST_Clip(rast, geometry)) As pvc
        FROM canopee2011_10m
        JOIN ct16 ON ST_Intersects(geometry, rast)
    ) As foo
    GROUP BY "GeoUID", (pvc).value
),
canopee11 AS (
    SELECT "GeoUID"
        ,round(100. * sum(total) FILTER (WHERE value in (3, 4)) / sum(total), 2) AS pct_esp_vert_2011
        ,round(100. * sum(total) FILTER (WHERE value = 3) / sum(total), 2) AS pct_esp_vert_low_2011
        ,round(100. * sum(total) FILTER (WHERE value = 4) / sum(total), 2) AS pct_esp_vert_high_2011
    FROM cnt11
    WHERE value > 0 -- discard no data, including postgis raster no data
    GROUP BY "GeoUID"
)
SELECT "GeoUID"
    ,st_area(geometry) ct_area_m2
    ,coalesce(pct_esp_vert_low_2011, 0) pct_esp_vert_low_2011
    ,coalesce(pct_esp_vert_high_2011, 0) pct_esp_vert_high_2011
    ,coalesce(pct_esp_vert_2011, 0) pct_esp_vert_2011
    ,coalesce(pct_esp_vert_low_2015, 0) pct_esp_vert_low_2015
    ,coalesce(pct_esp_vert_high_2015, 0) pct_esp_vert_high_2015
    ,coalesce(pct_esp_vert_2015, 0) pct_esp_vert_2015
    ,coalesce(pct_esp_vert_low_2017, 0) pct_esp_vert_low_2017
    ,coalesce(pct_esp_vert_high_2017, 0) pct_esp_vert_high_2017
    ,coalesce(pct_esp_vert_2017, 0) pct_esp_vert_2017
    ,coalesce(pct_esp_vert_low_2019, 0) pct_esp_vert_low_2019
    ,coalesce(pct_esp_vert_high_2019, 0) pct_esp_vert_high_2019
    ,coalesce(pct_esp_vert_2019, 0) pct_esp_vert_2019
FROM ct16
FULL JOIN canopee19 USING ("GeoUID")
FULL JOIN canopee17 USING ("GeoUID")
FULL JOIN canopee15 USING ("GeoUID")
FULL JOIN canopee11 USING ("GeoUID");

2.2.1.2 Buffers 250m

WITH ct16 AS (
    select "GeoUID", ST_Buffer(geometry, 250) geometry
    from ct16
),
cnt19 AS (
    SELECT "GeoUID"
        ,(pvc).value, SUM((pvc).count) As total
    FROM (SELECT "GeoUID"
            ,ST_ValueCount(ST_Clip(rast, geometry)) As pvc
        FROM canopee2019_10m
        JOIN ct16 ON ST_Intersects(geometry, rast)
    ) As foo
    GROUP BY "GeoUID", (pvc).value
),
canopee19 AS (
    SELECT "GeoUID"
        ,round(100. * sum(total) FILTER (WHERE value in (3, 4)) / sum(total), 2) AS pct_esp_vert_2019
        ,round(100. * sum(total) FILTER (WHERE value = 3) / sum(total), 2) AS pct_esp_vert_low_2019
        ,round(100. * sum(total) FILTER (WHERE value = 4) / sum(total), 2) AS pct_esp_vert_high_2019
    FROM cnt19
    WHERE value > 0 -- discard no data, including postgis raster no data
    GROUP BY "GeoUID"
),
cnt17 AS (
    SELECT "GeoUID"
        ,(pvc).value, SUM((pvc).count) As total
    FROM (SELECT "GeoUID"
            ,ST_ValueCount(ST_Clip(rast, geometry)) As pvc
        FROM canopee2017_10m
        JOIN ct16 ON ST_Intersects(geometry, rast)
    ) As foo
    GROUP BY "GeoUID", (pvc).value
),
canopee17 AS (
    SELECT "GeoUID"
        ,round(100. * sum(total) FILTER (WHERE value in (3, 4)) / sum(total), 2) AS pct_esp_vert_2017
        ,round(100. * sum(total) FILTER (WHERE value = 3) / sum(total), 2) AS pct_esp_vert_low_2017
        ,round(100. * sum(total) FILTER (WHERE value = 4) / sum(total), 2) AS pct_esp_vert_high_2017
    FROM cnt17
    WHERE value > 0 -- discard no data, including postgis raster no data
    GROUP BY "GeoUID"
),
cnt15 AS (
    SELECT "GeoUID"
        ,(pvc).value, SUM((pvc).count) As total
    FROM (SELECT "GeoUID"
            ,ST_ValueCount(ST_Clip(rast, geometry)) As pvc
        FROM canopee2015_10m
        JOIN ct16 ON ST_Intersects(geometry, rast)
    ) As foo
    GROUP BY "GeoUID", (pvc).value
),
canopee15 AS (
    SELECT "GeoUID"
        ,round(100. * sum(total) FILTER (WHERE value in (3, 4)) / sum(total), 2) AS pct_esp_vert_2015
        ,round(100. * sum(total) FILTER (WHERE value = 3) / sum(total), 2) AS pct_esp_vert_low_2015
        ,round(100. * sum(total) FILTER (WHERE value = 4) / sum(total), 2) AS pct_esp_vert_high_2015
    FROM cnt15
    WHERE value > 0 -- discard no data, including postgis raster no data
    GROUP BY "GeoUID"
),
cnt11 AS (
    SELECT "GeoUID"
        ,(pvc).value, SUM((pvc).count) As total
    FROM (SELECT "GeoUID"
            ,ST_ValueCount(ST_Clip(rast, geometry)) As pvc
        FROM canopee2011_10m
        JOIN ct16 ON ST_Intersects(geometry, rast)
    ) As foo
    GROUP BY "GeoUID", (pvc).value
),
canopee11 AS (
    SELECT "GeoUID"
        ,round(100. * sum(total) FILTER (WHERE value in (3, 4)) / sum(total), 2) AS pct_esp_vert_2011
        ,round(100. * sum(total) FILTER (WHERE value = 3) / sum(total), 2) AS pct_esp_vert_low_2011
        ,round(100. * sum(total) FILTER (WHERE value = 4) / sum(total), 2) AS pct_esp_vert_high_2011
    FROM cnt11
    WHERE value > 0 -- discard no data, including postgis raster no data
    GROUP BY "GeoUID"
)
SELECT "GeoUID"
    ,st_area(geometry) ct_area_m2
    ,coalesce(pct_esp_vert_low_2011, 0) pct_esp_vert_low_2011
    ,coalesce(pct_esp_vert_high_2011, 0) pct_esp_vert_high_2011
    ,coalesce(pct_esp_vert_2011, 0) pct_esp_vert_2011
    ,coalesce(pct_esp_vert_low_2015, 0) pct_esp_vert_low_2015
    ,coalesce(pct_esp_vert_high_2015, 0) pct_esp_vert_high_2015
    ,coalesce(pct_esp_vert_2015, 0) pct_esp_vert_2015
    ,coalesce(pct_esp_vert_low_2017, 0) pct_esp_vert_low_2017
    ,coalesce(pct_esp_vert_high_2017, 0) pct_esp_vert_high_2017
    ,coalesce(pct_esp_vert_2017, 0) pct_esp_vert_2017
    ,coalesce(pct_esp_vert_low_2019, 0) pct_esp_vert_low_2019
    ,coalesce(pct_esp_vert_high_2019, 0) pct_esp_vert_high_2019
    ,coalesce(pct_esp_vert_2019, 0) pct_esp_vert_2019
FROM ct16
FULL JOIN canopee19 USING ("GeoUID")
FULL JOIN canopee17 USING ("GeoUID")
FULL JOIN canopee15 USING ("GeoUID")
FULL JOIN canopee11 USING ("GeoUID");

2.2.1.3 Buffers 500m

WITH ct16 AS (
    select "GeoUID", ST_Buffer(geometry, 500) geometry
    from ct16
),
cnt19 AS (
    SELECT "GeoUID"
        ,(pvc).value, SUM((pvc).count) As total
    FROM (SELECT "GeoUID"
            ,ST_ValueCount(ST_Clip(rast, geometry)) As pvc
        FROM canopee2019_10m
        JOIN ct16 ON ST_Intersects(geometry, rast)
    ) As foo
    GROUP BY "GeoUID", (pvc).value
),
canopee19 AS (
    SELECT "GeoUID"
        ,round(100. * sum(total) FILTER (WHERE value in (3, 4)) / sum(total), 2) AS pct_esp_vert_2019
        ,round(100. * sum(total) FILTER (WHERE value = 3) / sum(total), 2) AS pct_esp_vert_low_2019
        ,round(100. * sum(total) FILTER (WHERE value = 4) / sum(total), 2) AS pct_esp_vert_high_2019
    FROM cnt19
    WHERE value > 0 -- discard no data, including postgis raster no data
    GROUP BY "GeoUID"
),
cnt17 AS (
    SELECT "GeoUID"
        ,(pvc).value, SUM((pvc).count) As total
    FROM (SELECT "GeoUID"
            ,ST_ValueCount(ST_Clip(rast, geometry)) As pvc
        FROM canopee2017_10m
        JOIN ct16 ON ST_Intersects(geometry, rast)
    ) As foo
    GROUP BY "GeoUID", (pvc).value
),
canopee17 AS (
    SELECT "GeoUID"
        ,round(100. * sum(total) FILTER (WHERE value in (3, 4)) / sum(total), 2) AS pct_esp_vert_2017
        ,round(100. * sum(total) FILTER (WHERE value = 3) / sum(total), 2) AS pct_esp_vert_low_2017
        ,round(100. * sum(total) FILTER (WHERE value = 4) / sum(total), 2) AS pct_esp_vert_high_2017
    FROM cnt17
    WHERE value > 0 -- discard no data, including postgis raster no data
    GROUP BY "GeoUID"
),
cnt15 AS (
    SELECT "GeoUID"
        ,(pvc).value, SUM((pvc).count) As total
    FROM (SELECT "GeoUID"
            ,ST_ValueCount(ST_Clip(rast, geometry)) As pvc
        FROM canopee2015_10m
        JOIN ct16 ON ST_Intersects(geometry, rast)
    ) As foo
    GROUP BY "GeoUID", (pvc).value
),
canopee15 AS (
    SELECT "GeoUID"
        ,round(100. * sum(total) FILTER (WHERE value in (3, 4)) / sum(total), 2) AS pct_esp_vert_2015
        ,round(100. * sum(total) FILTER (WHERE value = 3) / sum(total), 2) AS pct_esp_vert_low_2015
        ,round(100. * sum(total) FILTER (WHERE value = 4) / sum(total), 2) AS pct_esp_vert_high_2015
    FROM cnt15
    WHERE value > 0 -- discard no data, including postgis raster no data
    GROUP BY "GeoUID"
),
cnt11 AS (
    SELECT "GeoUID"
        ,(pvc).value, SUM((pvc).count) As total
    FROM (SELECT "GeoUID"
            ,ST_ValueCount(ST_Clip(rast, geometry)) As pvc
        FROM canopee2011_10m
        JOIN ct16 ON ST_Intersects(geometry, rast)
    ) As foo
    GROUP BY "GeoUID", (pvc).value
),
canopee11 AS (
    SELECT "GeoUID"
        ,round(100. * sum(total) FILTER (WHERE value in (3, 4)) / sum(total), 2) AS pct_esp_vert_2011
        ,round(100. * sum(total) FILTER (WHERE value = 3) / sum(total), 2) AS pct_esp_vert_low_2011
        ,round(100. * sum(total) FILTER (WHERE value = 4) / sum(total), 2) AS pct_esp_vert_high_2011
    FROM cnt11
    WHERE value > 0 -- discard no data, including postgis raster no data
    GROUP BY "GeoUID"
)
SELECT "GeoUID"
    ,st_area(geometry) ct_area_m2
    ,coalesce(pct_esp_vert_low_2011, 0) pct_esp_vert_low_2011
    ,coalesce(pct_esp_vert_high_2011, 0) pct_esp_vert_high_2011
    ,coalesce(pct_esp_vert_2011, 0) pct_esp_vert_2011
    ,coalesce(pct_esp_vert_low_2015, 0) pct_esp_vert_low_2015
    ,coalesce(pct_esp_vert_high_2015, 0) pct_esp_vert_high_2015
    ,coalesce(pct_esp_vert_2015, 0) pct_esp_vert_2015
    ,coalesce(pct_esp_vert_low_2017, 0) pct_esp_vert_low_2017
    ,coalesce(pct_esp_vert_high_2017, 0) pct_esp_vert_high_2017
    ,coalesce(pct_esp_vert_2017, 0) pct_esp_vert_2017
    ,coalesce(pct_esp_vert_low_2019, 0) pct_esp_vert_low_2019
    ,coalesce(pct_esp_vert_high_2019, 0) pct_esp_vert_high_2019
    ,coalesce(pct_esp_vert_2019, 0) pct_esp_vert_2019
FROM ct16
FULL JOIN canopee19 USING ("GeoUID")
FULL JOIN canopee17 USING ("GeoUID")
FULL JOIN canopee15 USING ("GeoUID")
FULL JOIN canopee11 USING ("GeoUID");

2.2.1.4 Buffers 750m

WITH ct16 AS (
    select "GeoUID", ST_Buffer(geometry, 750) geometry
    from ct16
),
cnt19 AS (
    SELECT "GeoUID"
        ,(pvc).value, SUM((pvc).count) As total
    FROM (SELECT "GeoUID"
            ,ST_ValueCount(ST_Clip(rast, geometry)) As pvc
        FROM canopee2019_10m
        JOIN ct16 ON ST_Intersects(geometry, rast)
    ) As foo
    GROUP BY "GeoUID", (pvc).value
),
canopee19 AS (
    SELECT "GeoUID"
        ,round(100. * sum(total) FILTER (WHERE value in (3, 4)) / sum(total), 2) AS pct_esp_vert_2019
        ,round(100. * sum(total) FILTER (WHERE value = 3) / sum(total), 2) AS pct_esp_vert_low_2019
        ,round(100. * sum(total) FILTER (WHERE value = 4) / sum(total), 2) AS pct_esp_vert_high_2019
    FROM cnt19
    WHERE value > 0 -- discard no data, including postgis raster no data
    GROUP BY "GeoUID"
),
cnt17 AS (
    SELECT "GeoUID"
        ,(pvc).value, SUM((pvc).count) As total
    FROM (SELECT "GeoUID"
            ,ST_ValueCount(ST_Clip(rast, geometry)) As pvc
        FROM canopee2017_10m
        JOIN ct16 ON ST_Intersects(geometry, rast)
    ) As foo
    GROUP BY "GeoUID", (pvc).value
),
canopee17 AS (
    SELECT "GeoUID"
        ,round(100. * sum(total) FILTER (WHERE value in (3, 4)) / sum(total), 2) AS pct_esp_vert_2017
        ,round(100. * sum(total) FILTER (WHERE value = 3) / sum(total), 2) AS pct_esp_vert_low_2017
        ,round(100. * sum(total) FILTER (WHERE value = 4) / sum(total), 2) AS pct_esp_vert_high_2017
    FROM cnt17
    WHERE value > 0 -- discard no data, including postgis raster no data
    GROUP BY "GeoUID"
),
cnt15 AS (
    SELECT "GeoUID"
        ,(pvc).value, SUM((pvc).count) As total
    FROM (SELECT "GeoUID"
            ,ST_ValueCount(ST_Clip(rast, geometry)) As pvc
        FROM canopee2015_10m
        JOIN ct16 ON ST_Intersects(geometry, rast)
    ) As foo
    GROUP BY "GeoUID", (pvc).value
),
canopee15 AS (
    SELECT "GeoUID"
        ,round(100. * sum(total) FILTER (WHERE value in (3, 4)) / sum(total), 2) AS pct_esp_vert_2015
        ,round(100. * sum(total) FILTER (WHERE value = 3) / sum(total), 2) AS pct_esp_vert_low_2015
        ,round(100. * sum(total) FILTER (WHERE value = 4) / sum(total), 2) AS pct_esp_vert_high_2015
    FROM cnt15
    WHERE value > 0 -- discard no data, including postgis raster no data
    GROUP BY "GeoUID"
),
cnt11 AS (
    SELECT "GeoUID"
        ,(pvc).value, SUM((pvc).count) As total
    FROM (SELECT "GeoUID"
            ,ST_ValueCount(ST_Clip(rast, geometry)) As pvc
        FROM canopee2011_10m
        JOIN ct16 ON ST_Intersects(geometry, rast)
    ) As foo
    GROUP BY "GeoUID", (pvc).value
),
canopee11 AS (
    SELECT "GeoUID"
        ,round(100. * sum(total) FILTER (WHERE value in (3, 4)) / sum(total), 2) AS pct_esp_vert_2011
        ,round(100. * sum(total) FILTER (WHERE value = 3) / sum(total), 2) AS pct_esp_vert_low_2011
        ,round(100. * sum(total) FILTER (WHERE value = 4) / sum(total), 2) AS pct_esp_vert_high_2011
    FROM cnt11
    WHERE value > 0 -- discard no data, including postgis raster no data
    GROUP BY "GeoUID"
)
SELECT "GeoUID"
    ,st_area(geometry) ct_area_m2
    ,coalesce(pct_esp_vert_low_2011, 0) pct_esp_vert_low_2011
    ,coalesce(pct_esp_vert_high_2011, 0) pct_esp_vert_high_2011
    ,coalesce(pct_esp_vert_2011, 0) pct_esp_vert_2011
    ,coalesce(pct_esp_vert_low_2015, 0) pct_esp_vert_low_2015
    ,coalesce(pct_esp_vert_high_2015, 0) pct_esp_vert_high_2015
    ,coalesce(pct_esp_vert_2015, 0) pct_esp_vert_2015
    ,coalesce(pct_esp_vert_low_2017, 0) pct_esp_vert_low_2017
    ,coalesce(pct_esp_vert_high_2017, 0) pct_esp_vert_high_2017
    ,coalesce(pct_esp_vert_2017, 0) pct_esp_vert_2017
    ,coalesce(pct_esp_vert_low_2019, 0) pct_esp_vert_low_2019
    ,coalesce(pct_esp_vert_high_2019, 0) pct_esp_vert_high_2019
    ,coalesce(pct_esp_vert_2019, 0) pct_esp_vert_2019
FROM ct16
FULL JOIN canopee19 USING ("GeoUID")
FULL JOIN canopee17 USING ("GeoUID")
FULL JOIN canopee15 USING ("GeoUID")
FULL JOIN canopee11 USING ("GeoUID");

2.3 Pampalon index

Get it here

pampalon <- read.xlsx("data/Canada2016Pampalon/A-MSDIData_Can2016_eng/1. EquivalenceTableCanada2016_ENG.xlsx", sheet = 2) %>%
  mutate(DA = as.character(DA)) %>%
  select(DA, SCOREMAT, SCORESOC)

# 2016 DA boundaries for Montreal
DA16 <- get_census(dataset='CA16', regions=list(CMA='24462'), level='DA', geo_format = "sf") %>%
  filter(Type == "DA") %>%
  st_transform(st_crs(bike_lane))
## Reading geo data from local cache.
pampalon <- DA16 %>%
  inner_join(pampalon, by = c("GeoUID" = "DA")) %>%
  as.data.frame()

# Get Pampalon 2006
pampalon06 <- read.xlsx("data/Canada2006Pampalon/A-MSDIData_Can2006_eng/1. CorrespondenceTable_Can2006_eng.xlsx", sheet = 2) %>%
  mutate(DA = as.character(DA)) %>%
  select(DA, DAPOP2006, SCOREMAT, SCORESOC)

# Get LUT DA2006 <-> DA2011 from StatCan
lut_da.1 <- read.csv("data/2011_92-156_DA_AD_txt/2011_92-156_DA_AD.txt", colClasses = "character", 
                     header = FALSE, col.names = c("DAUID2011.ADIDU2011", "DAUID2006.ADIDU2006", "DBUID2011", "DA_rel_flag")) %>%
  select(!c(DBUID2011, DA_rel_flag)) %>%
  unique()

# Link Pampalon 2011 to LUT and compute weighted mean of scores of Pampalon 2011
# NB: population numbers will diverge from  reality when more than one DA is merged into one DA of next census
pampalon06.11 <- pampalon06 %>%
  inner_join(lut_da.1, by = c("DA" = "DAUID2006.ADIDU2006")) %>%
  group_by(DAUID2011.ADIDU2011) %>%
  summarise(pop2006 = sum(DAPOP2006),
            SCOREMAT.06 = weighted.mean(SCOREMAT, DAPOP2006, na.rm = TRUE),
            SCORESOC.06 = weighted.mean(SCORESOC, DAPOP2006, na.rm = TRUE))

# Get Pampalon 2011
pampalon11 <- read.xlsx("data/Canada2011Pampalon/A-MSDIData_Can2011_eng/1. CorrespondenceTable_Can2011_eng.xlsx", sheet = 2) %>%
  mutate(DA = as.character(DA)) %>%
  select(DA, DAPOP2011, SCOREMAT, SCORESOC)

# Get LUT DA2011 <-> DA2016 from StatCan
lut_da <- read.csv("data/2016_92-156_DA_AD_csv/2016_92-156_DA_AD.csv", colClasses = "character") %>%
  select(!c(DBUID2016.IDIDU2016, DA_rel_flag.AD_ind_rel)) %>%
  unique()

# Link Pampalon 2011 to LUT, then to Pampalon 06 and finally compute weighted mean of scores of Pampalon 2011
pampalon11.16 <- pampalon11 %>%
  inner_join(lut_da, by = c("DA" = "DAUID2011.ADIDU2011")) %>%
  left_join(pampalon06.11, by =c("DA" = "DAUID2011.ADIDU2011")) %>%
  group_by(DAUID2016.ADIDU2016) %>%
  summarise(pop2011 = sum(DAPOP2011),
            SCOREMAT = weighted.mean(SCOREMAT, DAPOP2011, na.rm = TRUE),
            SCORESOC = weighted.mean(SCORESOC, DAPOP2011, na.rm = TRUE),
            SCOREMAT.06 = weighted.mean(SCOREMAT.06, pop2006, na.rm = TRUE),
            SCORESOC.06 = weighted.mean(SCORESOC.06, pop2006, na.rm = TRUE),
            pop2006 = sum(pop2006))

# Then link Pampalon 2011 to 2016
pampalon <- pampalon %>%
  left_join(pampalon11.16, by = c("GeoUID" = "DAUID2016.ADIDU2016"), suffix = c(".16", ".11"))

# Aggregate at the CT level
pampalon_CT <- pampalon %>%
  group_by(CT_UID) %>%
  summarise(wSCOREMAT.2016 = weighted.mean(SCOREMAT.16, Population, na.rm = TRUE),
            wSCORESOC.2016 = weighted.mean(SCORESOC.16, Population, na.rm = TRUE),
            wSCOREMAT.2011 = weighted.mean(SCOREMAT.11, pop2011, na.rm = TRUE),
            wSCORESOC.2011 = weighted.mean(SCORESOC.11, pop2011, na.rm = TRUE),
            wSCOREMAT.2006 = weighted.mean(SCOREMAT.06, pop2006, na.rm = TRUE),
            wSCORESOC.2006 = weighted.mean(SCORESOC.06, pop2006, na.rm = TRUE))

# Clean up
rm(lut_da, lut_da.1, pampalon11.16, pampalon06.11, pampalon11, pampalon06)

# Display map
pampalon_CT_geom <- CT16 %>%
  left_join(pampalon_CT, by = c("GeoUID" = "CT_UID")) %>%
  filter(interact_aoi)

pampalon_data <- bi_class(pampalon_CT_geom, x = wSCOREMAT.2016, y = wSCORESOC.2016, style = "quantile", dim = 3)
## Warning in classInt::classIntervals(bins_x, n = dim, style = "quantile"): var
## has missing values, omitted in finding classes
## Warning in classInt::classIntervals(bins_y, n = dim, style = "quantile"): var
## has missing values, omitted in finding classes
map <- ggplot() + 
  geom_sf(data = pampalon_data, mapping = aes(fill = bi_class), color = "white", size = 0.1, show.legend = FALSE) +
  bi_scale_fill(pal = "DkBlue", dim = 3) +
  labs(title = "Pampalon: material and social deprivation index") + 
  theme(panel.background = element_rect(fill = "white"),
        #axis.ticks = element_blank(),
        #axis.text = element_blank(),
        panel.grid = element_line(color = "darkgray", size = 0.2))
legend <- bi_legend(pal = "DkBlue",
                    dim = 3,
                    xlab = "Material ",
                    ylab = "Social ",
                    size = 8)
ggdraw() +
  draw_plot(map, 0, 0, 1, 1) +
  draw_plot(legend, 0.1, .7, 0.2, 0.2)

2.4 Gentrification

# Load gentrified CTs, 5 year span (from repo gentrification_metrics)
ding <- list()
ding[["2016"]] <- st_read("data/gentrified_5years.gpkg", "gentrified_ding_16", quiet=TRUE) %>%
  filter(cma_uid_16 == "24462") %>%
  st_transform(st_crs(bike_lane))
ding[["2011"]] <- st_read("data/gentrified_5years.gpkg", "gentrified_ding_11", quiet=TRUE) %>%
  filter(cma_uid_11 == "24462") %>%
  st_transform(st_crs(bike_lane))
ding[["2006"]] <- st_read("data/gentrified_5years.gpkg", "gentrified_ding_06", quiet=TRUE) %>%
  filter(cma_uid_06 == "24462") %>%
  st_transform(st_crs(bike_lane))

ding_map <- ding[["2016"]] %>%
  left_join(select(as.data.frame(CT16), GeoUID, interact_aoi), by = c("ct_uid_16" = "GeoUID")) %>%
  filter(interact_aoi)

ggplot(data = ding_map) + 
  geom_sf(aes(fill = gentrified_2016_2011, colour=gentrifiable_2011)) +
  scale_fill_manual(values = c("gray", "red", "darkgray"), name = "Gentrified in 2016") +
  scale_colour_manual(values = c("darkgray", "darkred", "darkgray"), name = "Gentrifiable in 2011") +
  labs(title = "Census tract gentrification status in 2016")

2.5 Build complete dataset

All variables + outcome linked at the CT level

.bike_lane_changes <- bike_lane_changes %>%
  as.data.frame() %>%
  select(GeoUID, ends_with("ct", ignore.case = FALSE), ends_with("b250", ignore.case = FALSE), ends_with("b500", ignore.case = FALSE), ends_with("b750", ignore.case = FALSE)) %>%
  select(GeoUID, starts_with("Bike_lane")) # Drop individual category lane length

bei_df <- CT16 %>%
  as.data.frame() %>%
  transmute(CT_UID = GeoUID,
            CD_UID = CD_UID,
            CSD_UID = CSD_UID,
            interact_aoi = interact_aoi,
            Population = Population) %>%
  left_join(pampalon_CT, by="CT_UID") %>%
  left_join(.bike_lane_changes, by=c("CT_UID" = "GeoUID")) %>%
  left_join(as.data.frame(esp_vert_ct), by=c("CT_UID" = "GeoUID")) %>%
  left_join(as.data.frame(esp_vert_buf250), by=c("CT_UID" = "GeoUID"), suffix=c("ct", "b250")) %>%
  left_join(as.data.frame(esp_vert_buf500), by=c("CT_UID" = "GeoUID")) %>%
  left_join(as.data.frame(esp_vert_buf750), by=c("CT_UID" = "GeoUID"), suffix=c("b500", "b750")) %>%
  left_join(select(as.data.frame(ding$`2016`), ct_uid_16, starts_with("gentrif")), by=c("CT_UID" = "ct_uid_16")) %>%
  left_join(select(as.data.frame(ding$`2011`), ct_uid_11, starts_with("gentrif")), by=c("CT_UID" = "ct_uid_11")) %>%
  left_join(select(as.data.frame(ding$`2006`), ct_uid_06, starts_with("gentrif")), by=c("CT_UID" = "ct_uid_06"))
  
  
head(bei_df)
write.csv(bei_df, "data/_results/bei_equity.csv", na="", row.names = FALSE)

Included variables:

  • Census Tracts variables
    • CT_UID: 2016 Census Tract ID
    • CD_UID: 2016 Census Division
    • CSD_UID: 2016 Census Subdivision
    • interact_aoi: Does CT belong to INTERACT study area?
    • Population: 2016 Population within CT
    • ct_area_m2.{ct|b{250|500|750}}: Area of CT or buffer of 250, 500 or 750m radius around CT, in square meters
    • gentrified_2016_2011: Is the CT gentrified in 2016?
    • gentrifiable_2011: Is the CT candidate to gentrification in 2011?
    • gentrified_2011_2006: Is the CT gentrified in 2011
    • gentrifiable_2006: Is the CT candidate to gentrification in 2006
    • gentrified_2006_2001: Is the CT gentrified in 2006
    • gentrifiable_2001: Is the CT candidate to gentrification in 2001
  • Pampalon’s metrics
    • wSCOREMAT.2016: Social deprivation index in 2016 (population weighted)
    • wSCORESOC.2016: Material deprivation index in 2016 (population weighted)
    • wSCOREMAT.2011: Social deprivation index in 2011 (population weighted)
    • wSCORESOC.2011: Material deprivation index in 2011 (population weighted)
  • Bike lane density
    • Bike_lane_total.{2016|2011}{ct|b{250|500|750}}: total length of bike lanes, in 2016 or 2011, within CT or buffer of 250, 500 or 750m radius
    • Bike_lane.by.street.{2016|2011}{ct|b{250|500|750}}: % of bike lanes compared to streets, in 2016 or 2011, within CT or buffer of 250, 500 or 750m radius
    • Bike_lane_diff.2011.2016{ct|b{250|500|750}}: change in total length of bike lanes between 2011 and 2011, within CT or buffer of 250, 500 or 750m radius
    • Bike_lane_diff.by.street.2011.2016{ct|b{250|500|750}}: change in total length of bike lanes between 2011 and 2011, normalized by street length, within CT or buffer of 250, 500 or 750m radius
    • Bike_lane_diff.by.area.2011.2016{ct|b{250|500|750}}: change in total length of bike lanes between 2011 and 2011, normalized by area, within CT or buffer of 250, 500 or 750m radius
  • Green spaces
    • pct_esp_vert_{2011|2015|2019}.{ct|b{250|500|750}}: % of green space in 2011, 2015 or 2019 within CT or buffer of 250, 500 or 750m radius
    • pct_esp_vert_{low|high}_{2011|2015|2019}.{ct|b{250|500|750}}: same as above, except for grass (low) and tree (high)
    • pct_esp_vert_diff{2011|2015}.{2015|2019}.{ct|b{250|500|750}}: change in % of green space between 2011 and 2015, 2011 and 2019 as well as 2011 and 2019, within CT or buffer of 250, 500 or 750m radius

3 Preliminary analyses

3.1 Whole CMA

3.1.1 SES variable distribution

Whole area ~ Montréal CMA / CMM

.bei_df_long <- bei_df %>% 
  units::drop_units() %>% 
  select(CT_UID, CD_UID, starts_with("wSCORE")) %>%
  pivot_longer(!c(CT_UID, CD_UID))

ggplot(.bei_df_long, aes(value)) +
  geom_histogram() + 
  facet_wrap(~name, scales = "free")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## Warning: Removed 122 rows containing non-finite values (stat_bin).

.bei_df_long <- bei_df %>% 
  units::drop_units() %>% 
  select(CT_UID, CD_UID, starts_with("gentrif")) %>%
  pivot_longer(!c(CT_UID, CD_UID))

ggplot(.bei_df_long, aes(value)) +
  geom_bar() + 
  facet_wrap(~name, scales = "free", ncol = 3)

3.1.2 BEI variable distributions

3.1.2.1 Census Tracts

.bei_df_long <- bei_df %>% 
  units::drop_units() %>% 
  select(CT_UID, CD_UID, matches("^Bike_lane.*ct$"), matches("^pct_esp_vert_diff.*ct$")) %>%
  pivot_longer(!c(CT_UID, CD_UID))

ggplot(.bei_df_long, aes(value)) +
  geom_histogram() + 
  facet_wrap(~name, scales = "free", ncol = 3)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## Warning: Removed 756 rows containing non-finite values (stat_bin).

3.1.2.2 Buffers 250m

.bei_df_long <- bei_df %>% 
  units::drop_units() %>% 
  select(CT_UID, CD_UID, matches("^Bike_lane.*b250$"), matches("^pct_esp_vert_diff.*b250$")) %>%
  pivot_longer(!c(CT_UID, CD_UID))

ggplot(.bei_df_long, aes(value)) +
  geom_histogram() + 
  facet_wrap(~name, scales = "free", ncol = 3)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## Warning: Removed 699 rows containing non-finite values (stat_bin).

3.1.2.3 Buffers 500m

.bei_df_long <- bei_df %>% 
  units::drop_units() %>% 
  select(CT_UID, CD_UID, matches("^Bike_lane.*b500$"), matches("^pct_esp_vert_diff.*b500$")) %>%
  pivot_longer(!c(CT_UID, CD_UID))

ggplot(.bei_df_long, aes(value)) +
  geom_histogram() + 
  facet_wrap(~name, scales = "free", ncol = 3)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## Warning: Removed 687 rows containing non-finite values (stat_bin).

3.1.2.4 Buffers 750m

.bei_df_long <- bei_df %>% 
  units::drop_units() %>% 
  select(CT_UID, CD_UID, matches("^Bike_lane.*b750$"), matches("^pct_esp_vert_diff.*b750$")) %>%
  pivot_longer(!c(CT_UID, CD_UID))

ggplot(.bei_df_long, aes(value)) +
  geom_histogram() + 
  facet_wrap(~name, scales = "free", ncol = 3)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## Warning: Removed 666 rows containing non-finite values (stat_bin).

3.2 INTERACT study area

INTERACT study area ~ Montréal, Laval, Longueuil, Brossard, St-Lambert

3.2.1 SES variable distribution

.bei_df_long <- bei_df %>% 
  filter(interact_aoi) %>%
  units::drop_units() %>% 
  select(CT_UID, CD_UID, starts_with("wSCORE")) %>%
  pivot_longer(!c(CT_UID, CD_UID))

ggplot(.bei_df_long, aes(value)) +
  geom_histogram() + 
  facet_wrap(~name, scales = "free")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## Warning: Removed 86 rows containing non-finite values (stat_bin).

.bei_df_long <- bei_df %>% 
  filter(interact_aoi) %>%
  units::drop_units() %>% 
  select(CT_UID, CD_UID, starts_with("gentrif")) %>%
  pivot_longer(!c(CT_UID, CD_UID))

ggplot(.bei_df_long, aes(value)) +
  geom_bar() + 
  facet_wrap(~name, scales = "free", ncol = 3)

3.2.2 BEI variable distributions

3.2.2.1 Census Tracts

.bei_df_long <- bei_df %>% 
  filter(interact_aoi) %>%
  units::drop_units() %>% 
  select(CT_UID, CD_UID, matches("^Bike_lane.*ct$"), matches("^pct_esp_vert_diff.*ct$")) %>%
  pivot_longer(!c(CT_UID, CD_UID))

ggplot(.bei_df_long, aes(value)) +
  geom_histogram() + 
  facet_wrap(~name, scales = "free", ncol = 3)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

3.2.2.2 Buffers 250m

.bei_df_long <- bei_df %>% 
  filter(interact_aoi) %>%
  units::drop_units() %>% 
  select(CT_UID, CD_UID, matches("^Bike_lane.*b250$"), matches("^pct_esp_vert_diff.*b250$")) %>%
  pivot_longer(!c(CT_UID, CD_UID))

ggplot(.bei_df_long, aes(value)) +
  geom_histogram() + 
  facet_wrap(~name, scales = "free", ncol = 3)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

3.2.2.3 Buffers 500m

.bei_df_long <- bei_df %>% 
  filter(interact_aoi) %>%
  units::drop_units() %>% 
  select(CT_UID, CD_UID, matches("^Bike_lane.*b500$"), matches("^pct_esp_vert_diff.*b500$")) %>%
  pivot_longer(!c(CT_UID, CD_UID))

ggplot(.bei_df_long, aes(value)) +
  geom_histogram() + 
  facet_wrap(~name, scales = "free", ncol = 3)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

3.2.2.4 Buffers 750m

.bei_df_long <- bei_df %>% 
  filter(interact_aoi) %>%
  units::drop_units() %>% 
  select(CT_UID, CD_UID, matches("^Bike_lane.*b750$"), matches("^pct_esp_vert_diff.*b750$")) %>%
  pivot_longer(!c(CT_UID, CD_UID))

ggplot(.bei_df_long, aes(value)) +
  geom_histogram() + 
  facet_wrap(~name, scales = "free", ncol = 3)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

4 Association between SES and BEI at baseline (2011)

Looking at objective #1 do urban interventions tend to be located in low SES neighborhoods?

4.1 Whole CMA

4.1.1 BEI vs Pampalon | material

4.1.1.1 Bike lane length

Bike lane ratio to streets (in %)

4.1.1.1.1 Census tract level
ggplot(units::drop_units(bei_df), aes(y=Bike_lane.by.street.2011ct, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(Bike_lane.by.street.2011ct ~ wSCOREMAT.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = Bike_lane.by.street.2011ct ~ wSCOREMAT.2011, data = units::drop_units(bei_df))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -12.692  -8.223  -2.539   4.865  91.035 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      9.3615     0.4427  21.146   <2e-16 ***
## wSCOREMAT.2011 -27.2836    10.8382  -2.517    0.012 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 11.66 on 701 degrees of freedom
##   (267 observations deleted due to missingness)
## Multiple R-squared:  0.008959,   Adjusted R-squared:  0.007545 
## F-statistic: 6.337 on 1 and 701 DF,  p-value: 0.01205
4.1.1.1.2 Buffers 250m
ggplot(units::drop_units(bei_df), aes(y=Bike_lane.by.street.2011b250, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(Bike_lane.by.street.2011b250 ~ wSCOREMAT.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = Bike_lane.by.street.2011b250 ~ wSCOREMAT.2011, data = units::drop_units(bei_df))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -12.679  -6.135  -1.549   3.578  91.612 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      9.4442     0.3569  26.464  < 2e-16 ***
## wSCOREMAT.2011 -30.6466     8.8234  -3.473 0.000545 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 9.531 on 720 degrees of freedom
##   (248 observations deleted due to missingness)
## Multiple R-squared:  0.01648,    Adjusted R-squared:  0.01511 
## F-statistic: 12.06 on 1 and 720 DF,  p-value: 0.0005448
4.1.1.1.3 Buffers 500m
ggplot(units::drop_units(bei_df), aes(y=Bike_lane.by.street.2011b500, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(Bike_lane.by.street.2011b500 ~ wSCOREMAT.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = Bike_lane.by.street.2011b500 ~ wSCOREMAT.2011, data = units::drop_units(bei_df))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -10.863  -4.306  -1.043   3.152  58.090 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      9.1999     0.2589  35.529  < 2e-16 ***
## wSCOREMAT.2011 -28.7292     6.4113  -4.481 8.63e-06 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 6.931 on 723 degrees of freedom
##   (245 observations deleted due to missingness)
## Multiple R-squared:  0.02702,    Adjusted R-squared:  0.02568 
## F-statistic: 20.08 on 1 and 723 DF,  p-value: 8.634e-06
4.1.1.1.4 Buffers 750m
ggplot(units::drop_units(bei_df), aes(y=Bike_lane.by.street.2011b750, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(Bike_lane.by.street.2011b750 ~ wSCOREMAT.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = Bike_lane.by.street.2011b750 ~ wSCOREMAT.2011, data = units::drop_units(bei_df))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -10.543  -3.805  -0.617   2.484  54.694 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      9.0780     0.2233  40.655  < 2e-16 ***
## wSCOREMAT.2011 -25.5780     5.5471  -4.611 4.73e-06 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 6.008 on 730 degrees of freedom
##   (238 observations deleted due to missingness)
## Multiple R-squared:  0.0283, Adjusted R-squared:  0.02697 
## F-statistic: 21.26 on 1 and 730 DF,  p-value: 4.731e-06

4.1.1.2 Canopy change

Measuring canopy (i.e. greenness ~ grass & trees) ratio within CT/buffer in 2011 (in %)

4.1.1.2.1 Census tract level
ggplot(units::drop_units(bei_df), aes(y=pct_esp_vert_2011ct, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_2011ct ~ wSCOREMAT.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_2011ct ~ wSCOREMAT.2011, data = units::drop_units(bei_df))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -56.637 -12.862   0.022  11.451  55.361 
## 
## Coefficients:
##                 Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      41.6677     0.6414  64.960  < 2e-16 ***
## wSCOREMAT.2011 -134.5745    17.3456  -7.758 2.22e-14 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 19.66 on 947 degrees of freedom
##   (21 observations deleted due to missingness)
## Multiple R-squared:  0.05976,    Adjusted R-squared:  0.05877 
## F-statistic: 60.19 on 1 and 947 DF,  p-value: 2.22e-14
4.1.1.2.2 Buffer 250m
ggplot(units::drop_units(bei_df), aes(y=pct_esp_vert_2011b250, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_2011b250 ~ wSCOREMAT.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_2011b250 ~ wSCOREMAT.2011, data = units::drop_units(bei_df))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -49.361 -10.527  -1.515   9.806  52.577 
## 
## Coefficients:
##                 Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      40.1560     0.5888  68.202  < 2e-16 ***
## wSCOREMAT.2011 -111.3184    15.9216  -6.992 5.13e-12 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 18.04 on 947 degrees of freedom
##   (21 observations deleted due to missingness)
## Multiple R-squared:  0.04909,    Adjusted R-squared:  0.04808 
## F-statistic: 48.88 on 1 and 947 DF,  p-value: 5.126e-12
4.1.1.2.3 Buffer 500m
ggplot(units::drop_units(bei_df), aes(y=pct_esp_vert_2011b500, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_2011b500 ~ wSCOREMAT.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_2011b500 ~ wSCOREMAT.2011, data = units::drop_units(bei_df))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -48.103 -10.363  -1.419   9.521  53.004 
## 
## Coefficients:
##                 Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      40.1269     0.5747  69.822  < 2e-16 ***
## wSCOREMAT.2011 -102.7972    15.5411  -6.615 6.22e-11 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 17.61 on 947 degrees of freedom
##   (21 observations deleted due to missingness)
## Multiple R-squared:  0.04416,    Adjusted R-squared:  0.04315 
## F-statistic: 43.75 on 1 and 947 DF,  p-value: 6.224e-11
4.1.1.2.4 Buffer 750m
ggplot(units::drop_units(bei_df), aes(y=pct_esp_vert_2011b750, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_2011b750 ~ wSCOREMAT.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_2011b750 ~ wSCOREMAT.2011, data = units::drop_units(bei_df))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -45.887 -11.012  -1.622   9.212  59.121 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)     40.2943     0.5706  70.615  < 2e-16 ***
## wSCOREMAT.2011 -95.7911    15.4305  -6.208 8.02e-10 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 17.49 on 947 degrees of freedom
##   (21 observations deleted due to missingness)
## Multiple R-squared:  0.0391, Adjusted R-squared:  0.03809 
## F-statistic: 38.54 on 1 and 947 DF,  p-value: 8.023e-10

4.1.1.3 Canopy (trees) change

Measuring high canopy (i.e. trees only) ratio within CT/buffer in 2011 (in %)

4.1.1.3.1 Census tract level
ggplot(units::drop_units(bei_df), aes(y=pct_esp_vert_high_2011ct, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_high_2011ct ~ wSCOREMAT.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_high_2011ct ~ wSCOREMAT.2011, data = units::drop_units(bei_df))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -30.667  -6.512  -1.130   4.976  59.824 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)     19.0646     0.3623   52.62   <2e-16 ***
## wSCOREMAT.2011 -99.5613     9.7983  -10.16   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 11.1 on 947 degrees of freedom
##   (21 observations deleted due to missingness)
## Multiple R-squared:  0.09831,    Adjusted R-squared:  0.09736 
## F-statistic: 103.2 on 1 and 947 DF,  p-value: < 2.2e-16
4.1.1.3.2 Buffer 250m
ggplot(units::drop_units(bei_df), aes(y=pct_esp_vert_high_2011b250, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_high_2011b250 ~ wSCOREMAT.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_high_2011b250 ~ wSCOREMAT.2011, data = units::drop_units(bei_df))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -26.932  -5.623  -1.232   4.227  55.658 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)     18.1746     0.3151  57.687   <2e-16 ***
## wSCOREMAT.2011 -84.8195     8.5197  -9.956   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 9.654 on 947 degrees of freedom
##   (21 observations deleted due to missingness)
## Multiple R-squared:  0.09475,    Adjusted R-squared:  0.09379 
## F-statistic: 99.12 on 1 and 947 DF,  p-value: < 2.2e-16
4.1.1.3.3 Buffer 500m
ggplot(units::drop_units(bei_df), aes(y=pct_esp_vert_high_2011b500, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_high_2011b500 ~ wSCOREMAT.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_high_2011b500 ~ wSCOREMAT.2011, data = units::drop_units(bei_df))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -26.472  -5.196  -1.260   4.060  55.869 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)     18.2182     0.3048  59.769   <2e-16 ***
## wSCOREMAT.2011 -80.1681     8.2427  -9.726   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 9.34 on 947 degrees of freedom
##   (21 observations deleted due to missingness)
## Multiple R-squared:  0.09082,    Adjusted R-squared:  0.08986 
## F-statistic: 94.59 on 1 and 947 DF,  p-value: < 2.2e-16
4.1.1.3.4 Buffer 750m
ggplot(units::drop_units(bei_df), aes(y=pct_esp_vert_high_2011b750, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_high_2011b750 ~ wSCOREMAT.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_high_2011b750 ~ wSCOREMAT.2011, data = units::drop_units(bei_df))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -25.889  -5.029  -1.078   3.761  81.212 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)     18.3174     0.3075  59.577   <2e-16 ***
## wSCOREMAT.2011 -77.0617     8.3142  -9.269   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 9.421 on 947 degrees of freedom
##   (21 observations deleted due to missingness)
## Multiple R-squared:  0.08317,    Adjusted R-squared:  0.0822 
## F-statistic: 85.91 on 1 and 947 DF,  p-value: < 2.2e-16

4.1.2 BEI vs Pampalon | social

4.1.2.1 Bike lane length

Bike lane ratio to streets (in %)

4.1.2.1.1 Census tract level
ggplot(units::drop_units(bei_df), aes(y=Bike_lane.by.street.2011ct, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(Bike_lane.by.street.2011ct ~ wSCORESOC.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = Bike_lane.by.street.2011ct ~ wSCORESOC.2011, data = units::drop_units(bei_df))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -10.711  -8.941  -2.409   4.872  91.128 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      8.8840     0.5597  15.873   <2e-16 ***
## wSCORESOC.2011  14.8411    14.5655   1.019    0.309    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 11.71 on 701 degrees of freedom
##   (267 observations deleted due to missingness)
## Multiple R-squared:  0.001479,   Adjusted R-squared:  5.44e-05 
## F-statistic: 1.038 on 1 and 701 DF,  p-value: 0.3086
4.1.2.1.2 Buffers 250m
ggplot(units::drop_units(bei_df), aes(y=Bike_lane.by.street.2011b250, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(Bike_lane.by.street.2011b250 ~ wSCORESOC.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = Bike_lane.by.street.2011b250 ~ wSCORESOC.2011, data = units::drop_units(bei_df))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -10.528  -5.806  -1.459   3.273  90.452 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      8.7613     0.4485  19.535   <2e-16 ***
## wSCORESOC.2011  23.5742    11.7408   2.008    0.045 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 9.583 on 720 degrees of freedom
##   (248 observations deleted due to missingness)
## Multiple R-squared:  0.005568,   Adjusted R-squared:  0.004187 
## F-statistic: 4.032 on 1 and 720 DF,  p-value: 0.04503
4.1.2.1.3 Buffers 500m
ggplot(units::drop_units(bei_df), aes(y=Bike_lane.by.street.2011b500, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(Bike_lane.by.street.2011b500 ~ wSCORESOC.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = Bike_lane.by.street.2011b500 ~ wSCORESOC.2011, data = units::drop_units(bei_df))
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -9.830 -4.615 -0.960  2.985 56.915 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      8.4945     0.3255  26.095  < 2e-16 ***
## wSCORESOC.2011  25.1606     8.5360   2.948  0.00331 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 6.985 on 723 degrees of freedom
##   (245 observations deleted due to missingness)
## Multiple R-squared:  0.01187,    Adjusted R-squared:  0.01051 
## F-statistic: 8.688 on 1 and 723 DF,  p-value: 0.003306
4.1.2.1.4 Buffers 750m
ggplot(units::drop_units(bei_df), aes(y=Bike_lane.by.street.2011b750, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(Bike_lane.by.street.2011b750 ~ wSCORESOC.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = Bike_lane.by.street.2011b750 ~ wSCORESOC.2011, data = units::drop_units(bei_df))
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -9.558 -4.095 -0.827  2.508 56.198 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      8.5094     0.2802  30.370  < 2e-16 ***
## wSCORESOC.2011  20.1654     7.3710   2.736  0.00637 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 6.064 on 730 degrees of freedom
##   (238 observations deleted due to missingness)
## Multiple R-squared:  0.01015,    Adjusted R-squared:  0.008793 
## F-statistic: 7.484 on 1 and 730 DF,  p-value: 0.006375

4.1.2.2 Canopy change

Measuring canopy (i.e. greenness ~ grass & trees) ratio within CT/buffer in 2011 (in %)

4.1.2.2.1 Census tract level
ggplot(units::drop_units(bei_df), aes(y=pct_esp_vert_2011ct, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_2011ct ~ wSCORESOC.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_2011ct ~ wSCORESOC.2011, data = units::drop_units(bei_df))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -55.985  -9.922   0.022  10.589  46.670 
## 
## Coefficients:
##                 Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      47.9152     0.6448   74.31   <2e-16 ***
## wSCORESOC.2011 -367.4519    18.2439  -20.14   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 16.96 on 947 degrees of freedom
##   (21 observations deleted due to missingness)
## Multiple R-squared:  0.2999, Adjusted R-squared:  0.2992 
## F-statistic: 405.7 on 1 and 947 DF,  p-value: < 2.2e-16
4.1.2.2.2 Buffer 250m
ggplot(units::drop_units(bei_df), aes(y=pct_esp_vert_2011b250, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_2011b250 ~ wSCORESOC.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_2011b250 ~ wSCORESOC.2011, data = units::drop_units(bei_df))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -53.688  -8.473  -0.351   8.196  47.075 
## 
## Coefficients:
##                 Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      46.0933     0.5805   79.40   <2e-16 ***
## wSCORESOC.2011 -345.7804    16.4258  -21.05   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 15.27 on 947 degrees of freedom
##   (21 observations deleted due to missingness)
## Multiple R-squared:  0.3188, Adjusted R-squared:  0.3181 
## F-statistic: 443.1 on 1 and 947 DF,  p-value: < 2.2e-16
4.1.2.2.3 Buffer 500m
ggplot(units::drop_units(bei_df), aes(y=pct_esp_vert_2011b500, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_2011b500 ~ wSCORESOC.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_2011b500 ~ wSCORESOC.2011, data = units::drop_units(bei_df))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -53.073  -7.791  -0.226   7.806  49.805 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)       45.82       0.57   80.38   <2e-16 ***
## wSCORESOC.2011  -330.47      16.13  -20.49   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 14.99 on 947 degrees of freedom
##   (21 observations deleted due to missingness)
## Multiple R-squared:  0.3072, Adjusted R-squared:  0.3065 
## F-statistic: 419.9 on 1 and 947 DF,  p-value: < 2.2e-16
4.1.2.2.4 Buffer 750m
ggplot(units::drop_units(bei_df), aes(y=pct_esp_vert_2011b750, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_2011b750 ~ wSCORESOC.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_2011b750 ~ wSCORESOC.2011, data = units::drop_units(bei_df))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -52.905  -8.180  -0.252   7.694  56.265 
## 
## Coefficients:
##                 Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      45.8440     0.5688   80.60   <2e-16 ***
## wSCORESOC.2011 -321.4983    16.0933  -19.98   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 14.96 on 947 degrees of freedom
##   (21 observations deleted due to missingness)
## Multiple R-squared:  0.2965, Adjusted R-squared:  0.2957 
## F-statistic: 399.1 on 1 and 947 DF,  p-value: < 2.2e-16

4.1.2.3 Canopy (trees) change

Measuring high canopy (i.e. trees only) ratio within CT/buffer in 2011 (in %)

4.1.2.3.1 Census tract level
ggplot(units::drop_units(bei_df), aes(y=pct_esp_vert_high_2011ct, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_high_2011ct ~ wSCORESOC.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_high_2011ct ~ wSCORESOC.2011, data = units::drop_units(bei_df))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -22.586  -7.331  -1.080   5.658  55.969 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)     20.4634     0.4304  47.541  < 2e-16 ***
## wSCORESOC.2011 -96.6304    12.1790  -7.934 5.96e-15 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 11.32 on 947 degrees of freedom
##   (21 observations deleted due to missingness)
## Multiple R-squared:  0.06233,    Adjusted R-squared:  0.06134 
## F-statistic: 62.95 on 1 and 947 DF,  p-value: 5.958e-15
4.1.2.3.2 Buffer 250m
ggplot(units::drop_units(bei_df), aes(y=pct_esp_vert_high_2011b250, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_high_2011b250 ~ wSCORESOC.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_high_2011b250 ~ wSCORESOC.2011, data = units::drop_units(bei_df))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -21.374  -6.478  -0.976   4.994  52.468 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)     19.4574     0.3725  52.235  < 2e-16 ***
## wSCORESOC.2011 -87.2741    10.5397  -8.281 4.15e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 9.798 on 947 degrees of freedom
##   (21 observations deleted due to missingness)
## Multiple R-squared:  0.06752,    Adjusted R-squared:  0.06653 
## F-statistic: 68.57 on 1 and 947 DF,  p-value: 4.149e-16
4.1.2.3.3 Buffer 500m
ggplot(units::drop_units(bei_df), aes(y=pct_esp_vert_high_2011b500, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_high_2011b500 ~ wSCORESOC.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_high_2011b500 ~ wSCORESOC.2011, data = units::drop_units(bei_df))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -21.181  -6.123  -0.941   4.868  52.894 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)     19.4028     0.3606  53.807  < 2e-16 ***
## wSCORESOC.2011 -80.9793    10.2029  -7.937 5.84e-15 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 9.485 on 947 degrees of freedom
##   (21 observations deleted due to missingness)
## Multiple R-squared:  0.06237,    Adjusted R-squared:  0.06138 
## F-statistic: 62.99 on 1 and 947 DF,  p-value: 5.838e-15
4.1.2.3.4 Buffer 750m
ggplot(units::drop_units(bei_df), aes(y=pct_esp_vert_high_2011b750, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_high_2011b750 ~ wSCORESOC.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_high_2011b750 ~ wSCORESOC.2011, data = units::drop_units(bei_df))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -21.157  -5.940  -1.049   4.276  81.057 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)     19.4523     0.3633  53.546   <2e-16 ***
## wSCORESOC.2011 -77.6318    10.2788  -7.553    1e-13 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 9.556 on 947 degrees of freedom
##   (21 observations deleted due to missingness)
## Multiple R-squared:  0.05681,    Adjusted R-squared:  0.05582 
## F-statistic: 57.04 on 1 and 947 DF,  p-value: 1.003e-13

4.1.3 BEI vs gentrified CT

Gentrified CT in 2011

4.1.3.1 Bike lane length

Bike lane ratio to streets (in %)

4.1.3.1.1 Census tract level
ggplot(drop_na(units::drop_units(bei_df), gentrified_2011_2006), aes(y=Bike_lane.by.street.2011ct, x=gentrified_2011_2006)) +
  geom_boxplot()
## Warning: Removed 199 rows containing non-finite values (stat_boxplot).

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2011_2006) %>%
  summarise(
    count = n(),
    mean = mean(Bike_lane.by.street.2011ct, na.rm = TRUE),
    sd = sd(Bike_lane.by.street.2011ct, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(Bike_lane.by.street.2011ct ~ gentrified_2016_2011, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value Pr(>F)
## gentrified_2016_2011   1    113   112.6   0.829  0.363
## Residuals            701  95266   135.9               
## 267 observations deleted due to missingness
4.1.3.1.2 Buffers 250m
ggplot(drop_na(units::drop_units(bei_df), gentrified_2011_2006), aes(y=Bike_lane.by.street.2011b250, x=gentrified_2011_2006)) +
  geom_boxplot()
## Warning: Removed 183 rows containing non-finite values (stat_boxplot).

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2011_2006) %>%
  summarise(
    count = n(),
    mean = mean(Bike_lane.by.street.2011b250, na.rm = TRUE),
    sd = sd(Bike_lane.by.street.2011b250, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(Bike_lane.by.street.2011b250 ~ gentrified_2016_2011, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value Pr(>F)
## gentrified_2016_2011   1      3    2.89   0.032  0.859
## Residuals            720  66058   91.75               
## 248 observations deleted due to missingness
4.1.3.1.3 Buffers 500m
ggplot(drop_na(units::drop_units(bei_df), gentrified_2011_2006), aes(y=Bike_lane.by.street.2011b500, x=gentrified_2011_2006)) +
  geom_boxplot()
## Warning: Removed 181 rows containing non-finite values (stat_boxplot).

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2011_2006) %>%
  summarise(
    count = n(),
    mean = mean(Bike_lane.by.street.2011b500, na.rm = TRUE),
    sd = sd(Bike_lane.by.street.2011b500, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(Bike_lane.by.street.2011b500 ~ gentrified_2016_2011, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value Pr(>F)
## gentrified_2016_2011   1     21   21.01    0.43  0.512
## Residuals            723  35349   48.89               
## 245 observations deleted due to missingness
4.1.3.1.4 Buffers 750m
ggplot(drop_na(units::drop_units(bei_df), gentrified_2011_2006), aes(y=Bike_lane.by.street.2011b750, x=gentrified_2011_2006)) +
  geom_boxplot()
## Warning: Removed 174 rows containing non-finite values (stat_boxplot).

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2011_2006) %>%
  summarise(
    count = n(),
    mean = mean(Bike_lane.by.street.2011b750, na.rm = TRUE),
    sd = sd(Bike_lane.by.street.2011b750, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(Bike_lane.by.street.2011b750 ~ gentrified_2016_2011, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value Pr(>F)
## gentrified_2016_2011   1     36   35.90   0.974  0.324
## Residuals            730  26911   36.86               
## 238 observations deleted due to missingness

4.1.3.2 Canopy change

Measuring canopy (i.e. greenness ~ grass & trees) ratio within CT/buffer in 2011 (in %)

4.1.3.2.1 Census tract level
ggplot(drop_na(units::drop_units(bei_df), gentrified_2011_2006), aes(y=pct_esp_vert_2011ct, x=gentrified_2011_2006)) +
  geom_boxplot()

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2011_2006) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_2011ct, na.rm = TRUE),
    sd = sd(pct_esp_vert_2011ct, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_2011ct ~ gentrified_2016_2011, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value Pr(>F)    
## gentrified_2016_2011   1  44236   44236     121 <2e-16 ***
## Residuals            945 345538     366                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 23 observations deleted due to missingness
4.1.3.2.2 Buffer 250m
ggplot(drop_na(units::drop_units(bei_df), gentrified_2011_2006), aes(y=pct_esp_vert_2011b250, x=gentrified_2011_2006)) +
  geom_boxplot()

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2011_2006) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_2011b250, na.rm = TRUE),
    sd = sd(pct_esp_vert_2011b250, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_2011b250 ~ gentrified_2016_2011, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value Pr(>F)    
## gentrified_2016_2011   1  34642   34642     113 <2e-16 ***
## Residuals            945 289603     306                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 23 observations deleted due to missingness
4.1.3.2.3 Buffer 500m
ggplot(drop_na(units::drop_units(bei_df), gentrified_2011_2006), aes(y=pct_esp_vert_2011b500, x=gentrified_2011_2006)) +
  geom_boxplot()

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2011_2006) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_2011b500, na.rm = TRUE),
    sd = sd(pct_esp_vert_2011b500, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_2011b500 ~ gentrified_2016_2011, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value Pr(>F)    
## gentrified_2016_2011   1  31182   31182   106.9 <2e-16 ***
## Residuals            945 275548     292                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 23 observations deleted due to missingness
4.1.3.2.4 Buffer 750m
ggplot(drop_na(units::drop_units(bei_df), gentrified_2011_2006), aes(y=pct_esp_vert_2011b750, x=gentrified_2011_2006)) +
  geom_boxplot()

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2011_2006) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_2011b750, na.rm = TRUE),
    sd = sd(pct_esp_vert_2011b750, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_2011b750 ~ gentrified_2016_2011, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value Pr(>F)    
## gentrified_2016_2011   1  29134   29134   101.5 <2e-16 ***
## Residuals            945 271367     287                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 23 observations deleted due to missingness

4.1.3.3 Canopy (trees) change

Measuring high canopy (i.e. trees only) ratio within CT/buffer in 2011 (in %)

4.1.3.3.1 Census tract level
ggplot(drop_na(units::drop_units(bei_df), gentrified_2011_2006), aes(y=pct_esp_vert_high_2011ct, x=gentrified_2011_2006)) +
  geom_boxplot()

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2011_2006) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_high_2011ct, na.rm = TRUE),
    sd = sd(pct_esp_vert_high_2011ct, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_high_2011ct ~ gentrified_2016_2011, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value   Pr(>F)    
## gentrified_2016_2011   1   2815    2815   21.16 4.81e-06 ***
## Residuals            945 125732     133                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 23 observations deleted due to missingness
4.1.3.3.2 Buffer 250m
ggplot(drop_na(units::drop_units(bei_df), gentrified_2011_2006), aes(y=pct_esp_vert_high_2011b250, x=gentrified_2011_2006)) +
  geom_boxplot()

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2011_2006) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_high_2011b250, na.rm = TRUE),
    sd = sd(pct_esp_vert_high_2011b250, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_high_2011b250 ~ gentrified_2016_2011, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value   Pr(>F)    
## gentrified_2016_2011   1   1780  1780.0   17.75 2.76e-05 ***
## Residuals            945  94772   100.3                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 23 observations deleted due to missingness
4.1.3.3.3 Buffer 500m
ggplot(drop_na(units::drop_units(bei_df), gentrified_2011_2006), aes(y=pct_esp_vert_high_2011b500, x=gentrified_2011_2006)) +
  geom_boxplot()

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2011_2006) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_high_2011b500, na.rm = TRUE),
    sd = sd(pct_esp_vert_high_2011b500, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_high_2011b500 ~ gentrified_2016_2011, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value   Pr(>F)    
## gentrified_2016_2011   1   1506  1506.3   16.12 6.42e-05 ***
## Residuals            945  88299    93.4                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 23 observations deleted due to missingness
4.1.3.3.4 Buffer 750m
ggplot(drop_na(units::drop_units(bei_df), gentrified_2011_2006), aes(y=pct_esp_vert_high_2011b750, x=gentrified_2011_2006)) +
  geom_boxplot()

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2011_2006) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_high_2011b750, na.rm = TRUE),
    sd = sd(pct_esp_vert_high_2011b750, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_high_2011b750 ~ gentrified_2016_2011, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value   Pr(>F)    
## gentrified_2016_2011   1   1368  1367.9   14.47 0.000151 ***
## Residuals            945  89326    94.5                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 23 observations deleted due to missingness

4.2 INTERACT study area

# keep only interact CT
bei_df_aoi <- filter(bei_df, interact_aoi)

4.2.1 BEI vs Pampalon | material

4.2.1.1 Bike lane length

Bike lane ratio to streets (in %)

4.2.1.1.1 Census tract level
ggplot(units::drop_units(bei_df_aoi), aes(y=Bike_lane.by.street.2011ct, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(Bike_lane.by.street.2011ct ~ wSCOREMAT.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = Bike_lane.by.street.2011ct ~ wSCOREMAT.2011, data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -12.200  -7.709  -2.064   5.143  59.255 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      8.8868     0.3611  24.613  < 2e-16 ***
## wSCOREMAT.2011 -27.1407     8.8021  -3.083  0.00213 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 9.409 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.01363,    Adjusted R-squared:  0.0122 
## F-statistic: 9.508 on 1 and 688 DF,  p-value: 0.002128
4.2.1.1.2 Buffers 250m
ggplot(units::drop_units(bei_df_aoi), aes(y=Bike_lane.by.street.2011b250, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(Bike_lane.by.street.2011b250 ~ wSCOREMAT.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = Bike_lane.by.street.2011b250 ~ wSCOREMAT.2011, data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -12.4394  -5.3193  -0.8782   3.8947  24.9430 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      8.9081     0.2544  35.019  < 2e-16 ***
## wSCOREMAT.2011 -33.4497     6.2014  -5.394 9.49e-08 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 6.629 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.04057,    Adjusted R-squared:  0.03918 
## F-statistic: 29.09 on 1 and 688 DF,  p-value: 9.492e-08
4.2.1.1.3 Buffers 500m
ggplot(units::drop_units(bei_df_aoi), aes(y=Bike_lane.by.street.2011b500, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(Bike_lane.by.street.2011b500 ~ wSCOREMAT.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = Bike_lane.by.street.2011b500 ~ wSCOREMAT.2011, data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -10.7672  -3.9200  -0.7691   3.1333  20.7230 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      8.9691     0.2162  41.488  < 2e-16 ***
## wSCOREMAT.2011 -31.0529     5.2703  -5.892 5.97e-09 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 5.634 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.04804,    Adjusted R-squared:  0.04665 
## F-statistic: 34.72 on 1 and 688 DF,  p-value: 5.971e-09
4.2.1.1.4 Buffers 750m
ggplot(units::drop_units(bei_df_aoi), aes(y=Bike_lane.by.street.2011b750, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(Bike_lane.by.street.2011b750 ~ wSCOREMAT.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = Bike_lane.by.street.2011b750 ~ wSCOREMAT.2011, data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -10.5371  -3.5685  -0.5231   2.4075  18.3871 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      8.9986     0.1938  46.431  < 2e-16 ***
## wSCOREMAT.2011 -26.8673     4.7248  -5.686 1.92e-08 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 5.05 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.04489,    Adjusted R-squared:  0.0435 
## F-statistic: 32.34 on 1 and 688 DF,  p-value: 1.918e-08

4.2.1.2 Canopy change

Measuring canopy (i.e. greenness ~ grass & trees) ratio within CT/buffer in 2011 (in %)

4.2.1.2.1 Census tract level
ggplot(units::drop_units(bei_df_aoi), aes(y=pct_esp_vert_2011ct, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_2011ct ~ wSCOREMAT.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_2011ct ~ wSCOREMAT.2011, data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -48.859 -11.624  -0.331   8.977  47.657 
## 
## Coefficients:
##                 Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      37.9617     0.5933  63.988  < 2e-16 ***
## wSCOREMAT.2011 -109.4130    14.4631  -7.565 1.25e-13 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 15.46 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.07679,    Adjusted R-squared:  0.07545 
## F-statistic: 57.23 on 1 and 688 DF,  p-value: 1.247e-13
4.2.1.2.2 Buffer 250m
ggplot(units::drop_units(bei_df_aoi), aes(y=pct_esp_vert_2011b250, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_2011b250 ~ wSCOREMAT.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_2011b250 ~ wSCOREMAT.2011, data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -41.973  -8.235  -0.954   7.170  41.284 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)     36.0871     0.4897  73.690  < 2e-16 ***
## wSCOREMAT.2011 -90.8096    11.9387  -7.606 9.29e-14 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 12.76 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.07757,    Adjusted R-squared:  0.07623 
## F-statistic: 57.86 on 1 and 688 DF,  p-value: 9.289e-14
4.2.1.2.3 Buffer 500m
ggplot(units::drop_units(bei_df_aoi), aes(y=pct_esp_vert_2011b500, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_2011b500 ~ wSCOREMAT.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_2011b500 ~ wSCOREMAT.2011, data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -40.955  -8.076  -0.976   7.123  40.579 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)     36.1464     0.4645  77.820  < 2e-16 ***
## wSCOREMAT.2011 -83.2220    11.3236  -7.349 5.66e-13 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 12.1 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.07279,    Adjusted R-squared:  0.07145 
## F-statistic: 54.01 on 1 and 688 DF,  p-value: 5.662e-13
4.2.1.2.4 Buffer 750m
ggplot(units::drop_units(bei_df_aoi), aes(y=pct_esp_vert_2011b750, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_2011b750 ~ wSCOREMAT.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_2011b750 ~ wSCOREMAT.2011, data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -38.621  -8.282  -0.894   7.305  39.867 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      36.211      0.451  80.287  < 2e-16 ***
## wSCOREMAT.2011  -76.126     10.995  -6.923 1.01e-11 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 11.75 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.06513,    Adjusted R-squared:  0.06377 
## F-statistic: 47.93 on 1 and 688 DF,  p-value: 1.013e-11

4.2.1.3 Canopy (trees) change

Measuring high canopy (i.e. trees only) ratio within CT/buffer in 2011 (in %)

4.2.1.3.1 Census tract level
ggplot(units::drop_units(bei_df_aoi), aes(y=pct_esp_vert_high_2011ct, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_high_2011ct ~ wSCOREMAT.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_high_2011ct ~ wSCOREMAT.2011, data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -29.954  -5.492  -0.802   4.630  44.704 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)     18.8069     0.3379   55.66   <2e-16 ***
## wSCOREMAT.2011 -96.7463     8.2370  -11.74   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 8.805 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.167,  Adjusted R-squared:  0.1658 
## F-statistic:   138 on 1 and 688 DF,  p-value: < 2.2e-16
4.2.1.3.2 Buffer 250m
ggplot(units::drop_units(bei_df_aoi), aes(y=pct_esp_vert_high_2011b250, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_high_2011b250 ~ wSCOREMAT.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_high_2011b250 ~ wSCOREMAT.2011, data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -25.9166  -4.2910  -0.8451   3.4739  27.8788 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)     17.6539     0.2668   66.17   <2e-16 ***
## wSCOREMAT.2011 -81.7658     6.5045  -12.57   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 6.953 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.1868, Adjusted R-squared:  0.1856 
## F-statistic:   158 on 1 and 688 DF,  p-value: < 2.2e-16
4.2.1.3.3 Buffer 500m
ggplot(units::drop_units(bei_df_aoi), aes(y=pct_esp_vert_high_2011b500, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_high_2011b500 ~ wSCOREMAT.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_high_2011b500 ~ wSCOREMAT.2011, data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -25.4603  -4.0485  -0.9957   3.5770  26.5204 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      17.738      0.250   70.96   <2e-16 ***
## wSCOREMAT.2011  -76.880      6.094  -12.62   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 6.515 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.1879, Adjusted R-squared:  0.1867 
## F-statistic: 159.1 on 1 and 688 DF,  p-value: < 2.2e-16
4.2.1.3.4 Buffer 750m
ggplot(units::drop_units(bei_df_aoi), aes(y=pct_esp_vert_high_2011b750, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_high_2011b750 ~ wSCOREMAT.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_high_2011b750 ~ wSCOREMAT.2011, data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -24.6658  -3.9100  -0.6752   3.4947  25.5210 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)     17.7572     0.2377   74.69   <2e-16 ***
## wSCOREMAT.2011 -72.9660     5.7960  -12.59   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 6.196 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.1872, Adjusted R-squared:  0.186 
## F-statistic: 158.5 on 1 and 688 DF,  p-value: < 2.2e-16

4.2.2 BEI vs Pampalon | social

4.2.2.1 Bike lane length

Bike lane ratio to streets (in %)

4.2.2.1.1 Census tract level
ggplot(units::drop_units(bei_df_aoi), aes(y=Bike_lane.by.street.2011ct, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(Bike_lane.by.street.2011ct ~ wSCORESOC.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = Bike_lane.by.street.2011ct ~ wSCORESOC.2011, data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -10.126  -8.483  -1.894   5.239  55.220 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      8.4115     0.4605  18.267   <2e-16 ***
## wSCORESOC.2011  13.9299    11.9135   1.169    0.243    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 9.464 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.001983,   Adjusted R-squared:  0.0005326 
## F-statistic: 1.367 on 1 and 688 DF,  p-value: 0.2427
4.2.2.1.2 Buffers 250m
ggplot(units::drop_units(bei_df_aoi), aes(y=Bike_lane.by.street.2011b250, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(Bike_lane.by.street.2011b250 ~ wSCORESOC.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = Bike_lane.by.street.2011b250 ~ wSCORESOC.2011, data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -9.6670 -4.9958 -0.7933  3.8783 24.9297 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      8.2950     0.3282  25.277   <2e-16 ***
## wSCORESOC.2011  18.3043     8.4904   2.156   0.0314 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 6.745 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.00671,    Adjusted R-squared:  0.005267 
## F-statistic: 4.648 on 1 and 688 DF,  p-value: 0.03144
4.2.2.1.3 Buffers 500m
ggplot(units::drop_units(bei_df_aoi), aes(y=Bike_lane.by.street.2011b500, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(Bike_lane.by.street.2011b500 ~ wSCORESOC.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = Bike_lane.by.street.2011b500 ~ wSCORESOC.2011, data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -9.4083 -4.1527 -0.6607  3.1263 20.5500 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      8.3114     0.2793  29.761  < 2e-16 ***
## wSCORESOC.2011  20.6704     7.2254   2.861  0.00435 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 5.74 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.01176,    Adjusted R-squared:  0.01032 
## F-statistic: 8.184 on 1 and 688 DF,  p-value: 0.004354
4.2.2.1.4 Buffers 750m
ggplot(units::drop_units(bei_df_aoi), aes(y=Bike_lane.by.street.2011b750, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(Bike_lane.by.street.2011b750 ~ wSCORESOC.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = Bike_lane.by.street.2011b750 ~ wSCORESOC.2011, data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -9.4108 -3.7743 -0.6908  2.4571 19.2676 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      8.3853     0.2497  33.575  < 2e-16 ***
## wSCORESOC.2011  19.7214     6.4615   3.052  0.00236 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 5.133 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.01336,    Adjusted R-squared:  0.01192 
## F-statistic: 9.315 on 1 and 688 DF,  p-value: 0.00236

4.2.2.2 Canopy change

Measuring canopy (i.e. greenness ~ grass & trees) ratio within CT/buffer in 2011 (in %)

4.2.2.2.1 Census tract level
ggplot(units::drop_units(bei_df_aoi), aes(y=pct_esp_vert_2011ct, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_2011ct ~ wSCORESOC.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_2011ct ~ wSCORESOC.2011, data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -41.160  -8.631  -0.185   7.616  48.600 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      44.829      0.637   70.37   <2e-16 ***
## wSCORESOC.2011 -308.789     16.482  -18.73   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 13.09 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.3378, Adjusted R-squared:  0.3369 
## F-statistic:   351 on 1 and 688 DF,  p-value: < 2.2e-16
4.2.2.2.2 Buffer 250m
ggplot(units::drop_units(bei_df_aoi), aes(y=pct_esp_vert_2011b250, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_2011b250 ~ wSCORESOC.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_2011b250 ~ wSCORESOC.2011, data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -31.464  -6.484  -0.223   5.905  40.372 
## 
## Coefficients:
##                 Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      42.0944     0.5106   82.44   <2e-16 ***
## wSCORESOC.2011 -269.0628    13.2111  -20.37   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 10.5 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.3761, Adjusted R-squared:  0.3752 
## F-statistic: 414.8 on 1 and 688 DF,  p-value: < 2.2e-16
4.2.2.2.3 Buffer 500m
ggplot(units::drop_units(bei_df_aoi), aes(y=pct_esp_vert_2011b500, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_2011b500 ~ wSCORESOC.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_2011b500 ~ wSCORESOC.2011, data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -25.562  -6.357  -0.285   6.124  37.934 
## 
## Coefficients:
##                 Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      41.7528     0.4873   85.68   <2e-16 ***
## wSCORESOC.2011 -250.7765    12.6084  -19.89   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 10.02 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.3651, Adjusted R-squared:  0.3642 
## F-statistic: 395.6 on 1 and 688 DF,  p-value: < 2.2e-16
4.2.2.2.4 Buffer 750m
ggplot(units::drop_units(bei_df_aoi), aes(y=pct_esp_vert_2011b750, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_2011b750 ~ wSCORESOC.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_2011b750 ~ wSCORESOC.2011, data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -25.132  -6.646  -0.006   5.852  36.685 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      41.573      0.475   87.52   <2e-16 ***
## wSCORESOC.2011 -239.092     12.290  -19.45   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 9.764 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.3549, Adjusted R-squared:  0.3539 
## F-statistic: 378.4 on 1 and 688 DF,  p-value: < 2.2e-16

4.2.2.3 Canopy (trees) change

Measuring high canopy (i.e. trees only) ratio within CT/buffer in 2011 (in %)

4.2.2.3.1 Census tract level
ggplot(units::drop_units(bei_df_aoi), aes(y=pct_esp_vert_high_2011ct, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_high_2011ct ~ wSCORESOC.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_high_2011ct ~ wSCORESOC.2011, data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -20.424  -6.539  -1.281   4.979  45.812 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)     19.9448     0.4585  43.496  < 2e-16 ***
## wSCORESOC.2011 -68.0181    11.8637  -5.733 1.47e-08 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 9.425 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.0456, Adjusted R-squared:  0.04421 
## F-statistic: 32.87 on 1 and 688 DF,  p-value: 1.475e-08
4.2.2.3.2 Buffer 250m
ggplot(units::drop_units(bei_df_aoi), aes(y=pct_esp_vert_high_2011b250, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_high_2011b250 ~ wSCORESOC.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_high_2011b250 ~ wSCORESOC.2011, data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -15.390  -5.380  -1.162   3.970  31.006 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)     18.4134     0.3681  50.025  < 2e-16 ***
## wSCORESOC.2011 -49.0855     9.5232  -5.154 3.33e-07 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 7.565 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.03718,    Adjusted R-squared:  0.03578 
## F-statistic: 26.57 on 1 and 688 DF,  p-value: 3.331e-07
4.2.2.3.3 Buffer 500m
ggplot(units::drop_units(bei_df_aoi), aes(y=pct_esp_vert_high_2011b500, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_high_2011b500 ~ wSCORESOC.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_high_2011b500 ~ wSCORESOC.2011, data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -14.032  -5.059  -1.291   4.093  29.050 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)     18.3659     0.3461  53.070  < 2e-16 ***
## wSCORESOC.2011 -42.5593     8.9537  -4.753 2.44e-06 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 7.113 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.0318, Adjusted R-squared:  0.03039 
## F-statistic: 22.59 on 1 and 688 DF,  p-value: 2.438e-06
4.2.2.3.4 Buffer 750m
ggplot(units::drop_units(bei_df_aoi), aes(y=pct_esp_vert_high_2011b750, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_high_2011b750 ~ wSCORESOC.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_high_2011b750 ~ wSCORESOC.2011, data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -13.114  -5.005  -1.117   3.803  26.489 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)     18.3146     0.3294  55.595  < 2e-16 ***
## wSCORESOC.2011 -38.8036     8.5231  -4.553 6.26e-06 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 6.771 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.02925,    Adjusted R-squared:  0.02784 
## F-statistic: 20.73 on 1 and 688 DF,  p-value: 6.262e-06

4.2.3 BEI vs gentrified CT

Gentrified CT in 2011

4.2.3.1 Bike lane length

Bike lane ratio to streets (in %)

4.2.3.1.1 Census tract level
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2011_2006), aes(y=Bike_lane.by.street.2011ct, x=gentrified_2011_2006)) +
  geom_boxplot()

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2011_2006) %>%
  summarise(
    count = n(),
    mean = mean(Bike_lane.by.street.2011ct, na.rm = TRUE),
    sd = sd(Bike_lane.by.street.2011ct, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(Bike_lane.by.street.2011ct ~ gentrified_2016_2011, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value Pr(>F)
## gentrified_2016_2011   1      5    4.95   0.056  0.813
## Residuals            688  60902   88.52               
## 15 observations deleted due to missingness
4.2.3.1.2 Buffers 250m
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2011_2006), aes(y=Bike_lane.by.street.2011b250, x=gentrified_2011_2006)) +
  geom_boxplot()

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2011_2006) %>%
  summarise(
    count = n(),
    mean = mean(Bike_lane.by.street.2011b250, na.rm = TRUE),
    sd = sd(Bike_lane.by.street.2011b250, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(Bike_lane.by.street.2011b250 ~ gentrified_2016_2011, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value Pr(>F)
## gentrified_2016_2011   1      2    1.67   0.037  0.847
## Residuals            688  31057   45.14               
## 15 observations deleted due to missingness
4.2.3.1.3 Buffers 500m
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2011_2006), aes(y=Bike_lane.by.street.2011b500, x=gentrified_2011_2006)) +
  geom_boxplot()

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2011_2006) %>%
  summarise(
    count = n(),
    mean = mean(Bike_lane.by.street.2011b500, na.rm = TRUE),
    sd = sd(Bike_lane.by.street.2011b500, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(Bike_lane.by.street.2011b500 ~ gentrified_2016_2011, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value Pr(>F)
## gentrified_2016_2011   1     22   21.78   0.664  0.416
## Residuals            688  22580   32.82               
## 15 observations deleted due to missingness
4.2.3.1.4 Buffers 750m
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2011_2006), aes(y=Bike_lane.by.street.2011b750, x=gentrified_2011_2006)) +
  geom_boxplot()

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2011_2006) %>%
  summarise(
    count = n(),
    mean = mean(Bike_lane.by.street.2011b750, na.rm = TRUE),
    sd = sd(Bike_lane.by.street.2011b750, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(Bike_lane.by.street.2011b750 ~ gentrified_2016_2011, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value Pr(>F)
## gentrified_2016_2011   1     41   40.84   1.547  0.214
## Residuals            688  18163   26.40               
## 15 observations deleted due to missingness

4.2.3.2 Canopy change

Measuring canopy (i.e. greenness ~ grass & trees) ratio within CT/buffer in 2011 (in %)

4.2.3.2.1 Census tract level
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2011_2006), aes(y=pct_esp_vert_2011ct, x=gentrified_2011_2006)) +
  geom_boxplot()

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2011_2006) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_2011ct, na.rm = TRUE),
    sd = sd(pct_esp_vert_2011ct, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_2011ct ~ gentrified_2016_2011, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value Pr(>F)    
## gentrified_2016_2011   1  23284   23284   102.9 <2e-16 ***
## Residuals            688 155714     226                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 15 observations deleted due to missingness
4.2.3.2.2 Buffer 250m
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2011_2006), aes(y=pct_esp_vert_2011b250, x=gentrified_2011_2006)) +
  geom_boxplot()

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2011_2006) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_2011b250, na.rm = TRUE),
    sd = sd(pct_esp_vert_2011b250, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_2011b250 ~ gentrified_2016_2011, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value Pr(>F)    
## gentrified_2016_2011   1  14776   14776   94.56 <2e-16 ***
## Residuals            688 107511     156                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 15 observations deleted due to missingness
4.2.3.2.3 Buffer 500m
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2011_2006), aes(y=pct_esp_vert_2011b500, x=gentrified_2011_2006)) +
  geom_boxplot()

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2011_2006) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_2011b500, na.rm = TRUE),
    sd = sd(pct_esp_vert_2011b500, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_2011b500 ~ gentrified_2016_2011, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value Pr(>F)    
## gentrified_2016_2011   1  12682   12682   90.12 <2e-16 ***
## Residuals            688  96815     141                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 15 observations deleted due to missingness
4.2.3.2.4 Buffer 750m
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2011_2006), aes(y=pct_esp_vert_2011b750, x=gentrified_2011_2006)) +
  geom_boxplot()

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2011_2006) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_2011b750, na.rm = TRUE),
    sd = sd(pct_esp_vert_2011b750, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_2011b750 ~ gentrified_2016_2011, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value Pr(>F)    
## gentrified_2016_2011   1  11029   11029   82.95 <2e-16 ***
## Residuals            688  91471     133                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 15 observations deleted due to missingness

4.2.3.3 Canopy (trees) change

Measuring high canopy (i.e. trees only) ratio within CT/buffer in 2011 (in %)

4.2.3.3.1 Census tract level
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2011_2006), aes(y=pct_esp_vert_high_2011ct, x=gentrified_2011_2006)) +
  geom_boxplot()

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2011_2006) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_high_2011ct, na.rm = TRUE),
    sd = sd(pct_esp_vert_high_2011ct, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_high_2011ct ~ gentrified_2016_2011, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value   Pr(>F)    
## gentrified_2016_2011   1   1856  1855.8   20.54 6.89e-06 ***
## Residuals            688  62160    90.3                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 15 observations deleted due to missingness
4.2.3.3.2 Buffer 250m
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2011_2006), aes(y=pct_esp_vert_high_2011b250, x=gentrified_2011_2006)) +
  geom_boxplot()

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2011_2006) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_high_2011b250, na.rm = TRUE),
    sd = sd(pct_esp_vert_high_2011b250, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_high_2011b250 ~ gentrified_2016_2011, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value   Pr(>F)    
## gentrified_2016_2011   1    786   786.4   13.43 0.000266 ***
## Residuals            688  40275    58.5                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 15 observations deleted due to missingness
4.2.3.3.3 Buffer 500m
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2011_2006), aes(y=pct_esp_vert_high_2011b500, x=gentrified_2011_2006)) +
  geom_boxplot()

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2011_2006) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_high_2011b500, na.rm = TRUE),
    sd = sd(pct_esp_vert_high_2011b500, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_high_2011b500 ~ gentrified_2016_2011, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value   Pr(>F)    
## gentrified_2016_2011   1    632   632.0   12.27 0.000491 ***
## Residuals            688  35449    51.5                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 15 observations deleted due to missingness
4.2.3.3.4 Buffer 750m
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2011_2006), aes(y=pct_esp_vert_high_2011b750, x=gentrified_2011_2006)) +
  geom_boxplot()

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2011_2006) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_high_2011b750, na.rm = TRUE),
    sd = sd(pct_esp_vert_high_2011b750, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_high_2011b750 ~ gentrified_2016_2011, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value  Pr(>F)   
## gentrified_2016_2011   1    476   476.4    10.2 0.00147 **
## Residuals            688  32147    46.7                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 15 observations deleted due to missingness

5 LEGACY STUFF | FOR REFERENCE ONLY

5.1 Association between SES and BEI variables

5.1.1 Pampalon | material vs. BEI

5.1.1.1 Bike lane length

Measuring bike lane length change within CT/buffers (in meters) between 2011 and 2016

5.1.1.1.1 Census tract level
ggplot(units::drop_units(bei_df), aes(x=Bike_lane_diff.2011.2016ct, y=wSCOREMAT.2016)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(wSCOREMAT.2016 ~ Bike_lane_diff.2011.2016ct, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = wSCOREMAT.2016 ~ Bike_lane_diff.2011.2016ct, data = units::drop_units(bei_df))
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.14093 -0.02165 -0.00058  0.02353  0.13849 
## 
## Coefficients:
##                              Estimate Std. Error t value Pr(>|t|)  
## (Intercept)                 3.904e-04  1.219e-03    0.32   0.7488  
## Bike_lane_diff.2011.2016ct -3.201e-06  1.301e-06   -2.46   0.0141 *
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.03602 on 948 degrees of freedom
##   (20 observations deleted due to missingness)
## Multiple R-squared:  0.006345,   Adjusted R-squared:  0.005297 
## F-statistic: 6.053 on 1 and 948 DF,  p-value: 0.01406
5.1.1.1.2 Buffers 250m
ggplot(units::drop_units(bei_df), aes(x=Bike_lane_diff.2011.2016b250, y=wSCOREMAT.2016)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(wSCOREMAT.2016 ~ Bike_lane_diff.2011.2016b250, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = wSCOREMAT.2016 ~ Bike_lane_diff.2011.2016b250, data = units::drop_units(bei_df))
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.141558 -0.021775 -0.000925  0.023297  0.137860 
## 
## Coefficients:
##                                Estimate Std. Error t value Pr(>|t|)   
## (Intercept)                   1.016e-03  1.277e-03   0.796  0.42622   
## Bike_lane_diff.2011.2016b250 -2.258e-06  7.906e-07  -2.856  0.00438 **
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.03598 on 948 degrees of freedom
##   (20 observations deleted due to missingness)
## Multiple R-squared:  0.008533,   Adjusted R-squared:  0.007487 
## F-statistic: 8.159 on 1 and 948 DF,  p-value: 0.004378
5.1.1.1.3 Buffers 500m
ggplot(units::drop_units(bei_df), aes(x=Bike_lane_diff.2011.2016b500, y=wSCOREMAT.2016)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(wSCOREMAT.2016 ~ Bike_lane_diff.2011.2016b500, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = wSCOREMAT.2016 ~ Bike_lane_diff.2011.2016b500, data = units::drop_units(bei_df))
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.142173 -0.021775 -0.000562  0.023345  0.137246 
## 
## Coefficients:
##                                Estimate Std. Error t value Pr(>|t|)   
## (Intercept)                   1.630e-03  1.328e-03   1.228  0.21993   
## Bike_lane_diff.2011.2016b500 -1.772e-06  5.396e-07  -3.284  0.00106 **
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.03593 on 948 degrees of freedom
##   (20 observations deleted due to missingness)
## Multiple R-squared:  0.01125,    Adjusted R-squared:  0.01021 
## F-statistic: 10.79 on 1 and 948 DF,  p-value: 0.00106
5.1.1.1.4 Buffers 750m
ggplot(units::drop_units(bei_df), aes(x=Bike_lane_diff.2011.2016b750, y=wSCOREMAT.2016)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(wSCOREMAT.2016 ~ Bike_lane_diff.2011.2016b750, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = wSCOREMAT.2016 ~ Bike_lane_diff.2011.2016b750, data = units::drop_units(bei_df))
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.142411 -0.022130 -0.000503  0.022855  0.137007 
## 
## Coefficients:
##                                Estimate Std. Error t value Pr(>|t|)   
## (Intercept)                   1.869e-03  1.372e-03   1.362  0.17341   
## Bike_lane_diff.2011.2016b750 -1.258e-06  3.904e-07  -3.221  0.00132 **
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.03594 on 948 degrees of freedom
##   (20 observations deleted due to missingness)
## Multiple R-squared:  0.01083,    Adjusted R-squared:  0.009782 
## F-statistic: 10.38 on 1 and 948 DF,  p-value: 0.001321

5.1.1.2 Bike lane / street

Measuring bike lane length change, normalized by length of streets within CT/buffers (in meters)

5.1.1.2.1 Census tract level
ggplot(units::drop_units(bei_df), aes(x=Bike_lane_diff.by.street.2011.2016ct, y=wSCOREMAT.2016)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(wSCOREMAT.2016 ~ Bike_lane_diff.by.street.2011.2016ct, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = wSCOREMAT.2016 ~ Bike_lane_diff.by.street.2011.2016ct, 
##     data = units::drop_units(bei_df))
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.140946 -0.025988  0.001677  0.026813  0.138472 
## 
## Coefficients:
##                                        Estimate Std. Error t value Pr(>|t|)
## (Intercept)                           0.0004043  0.0016064   0.252    0.801
## Bike_lane_diff.by.street.2011.2016ct -0.0001646  0.0001551  -1.061    0.289
## 
## Residual standard error: 0.03978 on 702 degrees of freedom
##   (266 observations deleted due to missingness)
## Multiple R-squared:  0.001602,   Adjusted R-squared:  0.0001796 
## F-statistic: 1.126 on 1 and 702 DF,  p-value: 0.2889
5.1.1.2.2 Buffer 250m
ggplot(units::drop_units(bei_df), aes(x=Bike_lane_diff.by.street.2011.2016b250, y=wSCOREMAT.2016)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(wSCOREMAT.2016 ~ Bike_lane_diff.by.street.2011.2016b250, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = wSCOREMAT.2016 ~ Bike_lane_diff.by.street.2011.2016b250, 
##     data = units::drop_units(bei_df))
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.142037 -0.025277  0.001961  0.026047  0.137382 
## 
## Coefficients:
##                                          Estimate Std. Error t value Pr(>|t|)  
## (Intercept)                             0.0014946  0.0016761   0.892    0.373  
## Bike_lane_diff.by.street.2011.2016b250 -0.0005511  0.0002453  -2.247    0.025 *
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.03926 on 721 degrees of freedom
##   (247 observations deleted due to missingness)
## Multiple R-squared:  0.006952,   Adjusted R-squared:  0.005574 
## F-statistic: 5.047 on 1 and 721 DF,  p-value: 0.02497
5.1.1.2.3 Buffer 500m
ggplot(units::drop_units(bei_df), aes(x=Bike_lane_diff.by.street.2011.2016b500, y=wSCOREMAT.2016)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(wSCOREMAT.2016 ~ Bike_lane_diff.by.street.2011.2016b500, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = wSCOREMAT.2016 ~ Bike_lane_diff.by.street.2011.2016b500, 
##     data = units::drop_units(bei_df))
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.142775 -0.025498  0.001986  0.026003  0.136643 
## 
## Coefficients:
##                                          Estimate Std. Error t value Pr(>|t|)
## (Intercept)                             0.0022332  0.0017686   1.263  0.20711
## Bike_lane_diff.by.street.2011.2016b500 -0.0008014  0.0003025  -2.649  0.00825
##                                          
## (Intercept)                              
## Bike_lane_diff.by.street.2011.2016b500 **
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.03916 on 724 degrees of freedom
##   (244 observations deleted due to missingness)
## Multiple R-squared:  0.009598,   Adjusted R-squared:  0.00823 
## F-statistic: 7.016 on 1 and 724 DF,  p-value: 0.008253
5.1.1.2.4 Buffer 750m
ggplot(units::drop_units(bei_df), aes(x=Bike_lane_diff.by.street.2011.2016b750, y=wSCOREMAT.2016)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(wSCOREMAT.2016 ~ Bike_lane_diff.by.street.2011.2016b750, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = wSCOREMAT.2016 ~ Bike_lane_diff.by.street.2011.2016b750, 
##     data = units::drop_units(bei_df))
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.142956 -0.025333  0.002213  0.026062  0.136463 
## 
## Coefficients:
##                                          Estimate Std. Error t value Pr(>|t|)
## (Intercept)                             0.0024140  0.0018380   1.313  0.18946
## Bike_lane_diff.by.street.2011.2016b750 -0.0009010  0.0003432  -2.625  0.00884
##                                          
## (Intercept)                              
## Bike_lane_diff.by.street.2011.2016b750 **
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.03906 on 731 degrees of freedom
##   (237 observations deleted due to missingness)
## Multiple R-squared:  0.00934,    Adjusted R-squared:  0.007985 
## F-statistic: 6.892 on 1 and 731 DF,  p-value: 0.008838

5.1.1.3 Bike lane / area

Measuring bike lane length change, normalized by area within CT/buffers (in meters)

5.1.1.3.1 Census tract level
ggplot(units::drop_units(bei_df), aes(x=Bike_lane_diff.by.area.2011.2016ct, y=wSCOREMAT.2016)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(wSCOREMAT.2016 ~ Bike_lane_diff.by.area.2011.2016ct, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = wSCOREMAT.2016 ~ Bike_lane_diff.by.area.2011.2016ct, 
##     data = units::drop_units(bei_df))
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.140461 -0.022162 -0.000097  0.023480  0.138958 
## 
## Coefficients:
##                                      Estimate Std. Error t value Pr(>|t|)
## (Intercept)                        -8.102e-05  1.265e-03  -0.064    0.949
## Bike_lane_diff.by.area.2011.2016ct -8.785e-04  1.104e-03  -0.796    0.426
## 
## Residual standard error: 0.03612 on 948 degrees of freedom
##   (20 observations deleted due to missingness)
## Multiple R-squared:  0.0006678,  Adjusted R-squared:  -0.0003864 
## F-statistic: 0.6335 on 1 and 948 DF,  p-value: 0.4263
5.1.1.3.2 Buffer 250m
ggplot(units::drop_units(bei_df), aes(x=Bike_lane_diff.by.area.2011.2016b250, y=wSCOREMAT.2016)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(wSCOREMAT.2016 ~ Bike_lane_diff.by.area.2011.2016b250, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = wSCOREMAT.2016 ~ Bike_lane_diff.by.area.2011.2016b250, 
##     data = units::drop_units(bei_df))
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.141396 -0.022428 -0.000406  0.023373  0.138023 
## 
## Coefficients:
##                                        Estimate Std. Error t value Pr(>|t|)  
## (Intercept)                           0.0008536  0.0013002   0.657   0.5117  
## Bike_lane_diff.by.area.2011.2016b250 -0.0032359  0.0014014  -2.309   0.0212 *
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.03603 on 948 degrees of freedom
##   (20 observations deleted due to missingness)
## Multiple R-squared:  0.005593,   Adjusted R-squared:  0.004544 
## F-statistic: 5.332 on 1 and 948 DF,  p-value: 0.02115
5.1.1.3.3 Buffer 500m
ggplot(units::drop_units(bei_df), aes(x=Bike_lane_diff.by.area.2011.2016b500, y=wSCOREMAT.2016)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(wSCOREMAT.2016 ~ Bike_lane_diff.by.area.2011.2016b500, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = wSCOREMAT.2016 ~ Bike_lane_diff.by.area.2011.2016b500, 
##     data = units::drop_units(bei_df))
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.141827 -0.021977 -0.000228  0.023279  0.137592 
## 
## Coefficients:
##                                       Estimate Std. Error t value Pr(>|t|)   
## (Intercept)                           0.001285   0.001332   0.965  0.33497   
## Bike_lane_diff.by.area.2011.2016b500 -0.004451   0.001634  -2.724  0.00657 **
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.03599 on 948 degrees of freedom
##   (20 observations deleted due to missingness)
## Multiple R-squared:  0.007765,   Adjusted R-squared:  0.006718 
## F-statistic: 7.419 on 1 and 948 DF,  p-value: 0.006573
5.1.1.3.4 Buffer 750m
ggplot(units::drop_units(bei_df), aes(x=Bike_lane_diff.by.area.2011.2016b750, y=wSCOREMAT.2016)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(wSCOREMAT.2016 ~ Bike_lane_diff.by.area.2011.2016b750, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = wSCOREMAT.2016 ~ Bike_lane_diff.by.area.2011.2016b750, 
##     data = units::drop_units(bei_df))
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.141943 -0.022225 -0.000778  0.023093  0.137475 
## 
## Coefficients:
##                                       Estimate Std. Error t value Pr(>|t|)   
## (Intercept)                           0.001401   0.001357   1.033  0.30193   
## Bike_lane_diff.by.area.2011.2016b750 -0.004838   0.001794  -2.697  0.00713 **
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.03599 on 948 degrees of freedom
##   (20 observations deleted due to missingness)
## Multiple R-squared:  0.007613,   Adjusted R-squared:  0.006566 
## F-statistic: 7.272 on 1 and 948 DF,  p-value: 0.007126

5.1.1.4 Canopy change

Measuring canopy (i.e. greenness) ratio change within CT/buffer between 2011 and 2017 (in %)

5.1.1.4.1 Census tract level
ggplot(units::drop_units(bei_df), aes(x=pct_esp_vert_diff_2011.2017ct, y=wSCOREMAT.2016)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(wSCOREMAT.2016 ~ pct_esp_vert_diff_2011.2017ct, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = wSCOREMAT.2016 ~ pct_esp_vert_diff_2011.2017ct, 
##     data = units::drop_units(bei_df))
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.141177 -0.022286  0.000108  0.024187  0.144043 
## 
## Coefficients:
##                                 Estimate Std. Error t value Pr(>|t|)  
## (Intercept)                    0.0018129  0.0015560   1.165    0.244  
## pct_esp_vert_diff_2011.2017ct -0.0004790  0.0002163  -2.215    0.027 *
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.03604 on 948 degrees of freedom
##   (20 observations deleted due to missingness)
## Multiple R-squared:  0.005147,   Adjusted R-squared:  0.004097 
## F-statistic: 4.905 on 1 and 948 DF,  p-value: 0.02702
5.1.1.4.2 Buffer 250m
ggplot(units::drop_units(bei_df), aes(x=pct_esp_vert_diff_2011.2017b250, y=wSCOREMAT.2016)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(wSCOREMAT.2016 ~ pct_esp_vert_diff_2011.2017b250, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = wSCOREMAT.2016 ~ pct_esp_vert_diff_2011.2017b250, 
##     data = units::drop_units(bei_df))
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.140637 -0.022129  0.000271  0.024096  0.139629 
## 
## Coefficients:
##                                   Estimate Std. Error t value Pr(>|t|)   
## (Intercept)                      0.0028608  0.0015659   1.827  0.06803 . 
## pct_esp_vert_diff_2011.2017b250 -0.0007240  0.0002278  -3.178  0.00153 **
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.03594 on 948 degrees of freedom
##   (20 observations deleted due to missingness)
## Multiple R-squared:  0.01054,    Adjusted R-squared:  0.009497 
## F-statistic:  10.1 on 1 and 948 DF,  p-value: 0.001532
5.1.1.4.3 Buffer 500m
ggplot(units::drop_units(bei_df), aes(x=pct_esp_vert_diff_2011.2017b500, y=wSCOREMAT.2016)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(wSCOREMAT.2016 ~ pct_esp_vert_diff_2011.2017b500, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = wSCOREMAT.2016 ~ pct_esp_vert_diff_2011.2017b500, 
##     data = units::drop_units(bei_df))
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.140177 -0.022065  0.000376  0.023922  0.139495 
## 
## Coefficients:
##                                   Estimate Std. Error t value Pr(>|t|)   
## (Intercept)                      0.0029249  0.0015828   1.848  0.06493 . 
## pct_esp_vert_diff_2011.2017b500 -0.0007428  0.0002348  -3.163  0.00161 **
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.03594 on 948 degrees of freedom
##   (20 observations deleted due to missingness)
## Multiple R-squared:  0.01044,    Adjusted R-squared:  0.009401 
## F-statistic: 10.01 on 1 and 948 DF,  p-value: 0.00161
5.1.1.4.4 Buffer 750m
ggplot(units::drop_units(bei_df), aes(x=pct_esp_vert_diff_2011.2017b750, y=wSCOREMAT.2016)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(wSCOREMAT.2016 ~ pct_esp_vert_diff_2011.2017b750, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = wSCOREMAT.2016 ~ pct_esp_vert_diff_2011.2017b750, 
##     data = units::drop_units(bei_df))
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.140199 -0.021925  0.000296  0.023997  0.139261 
## 
## Coefficients:
##                                   Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                      0.0033072  0.0016028   2.063 0.039349 *  
## pct_esp_vert_diff_2011.2017b750 -0.0008314  0.0002429  -3.423 0.000646 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.03591 on 948 degrees of freedom
##   (20 observations deleted due to missingness)
## Multiple R-squared:  0.01221,    Adjusted R-squared:  0.01117 
## F-statistic: 11.72 on 1 and 948 DF,  p-value: 0.0006457

5.1.2 Pampalon | social vs. BEI

5.1.2.1 Bike lane length

Measuring bike lane length change within CT/buffers (in meters) between 2011 and 2016

5.1.2.1.1 Census tract level
ggplot(units::drop_units(bei_df), aes(x=Bike_lane_diff.2011.2016ct, y=wSCORESOC.2016)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(wSCORESOC.2016 ~ Bike_lane_diff.2011.2016ct, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = wSCORESOC.2016 ~ Bike_lane_diff.2011.2016ct, data = units::drop_units(bei_df))
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.076895 -0.022870  0.000003  0.024011  0.094864 
## 
## Coefficients:
##                              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                 1.810e-02  9.833e-04  18.411   <2e-16 ***
## Bike_lane_diff.2011.2016ct -2.671e-07  1.050e-06  -0.254    0.799    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.02906 on 948 degrees of freedom
##   (20 observations deleted due to missingness)
## Multiple R-squared:  6.83e-05,   Adjusted R-squared:  -0.0009865 
## F-statistic: 0.06475 on 1 and 948 DF,  p-value: 0.7992
5.1.2.1.2 Buffers 250m
ggplot(units::drop_units(bei_df), aes(x=Bike_lane_diff.2011.2016b250, y=wSCORESOC.2016)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(wSCORESOC.2016 ~ Bike_lane_diff.2011.2016b250, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = wSCORESOC.2016 ~ Bike_lane_diff.2011.2016b250, data = units::drop_units(bei_df))
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.075420 -0.022369  0.000121  0.023588  0.096340 
## 
## Coefficients:
##                               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                  1.663e-02  1.025e-03  16.221  < 2e-16 ***
## Bike_lane_diff.2011.2016b250 2.148e-06  6.348e-07   3.383 0.000746 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.02889 on 948 degrees of freedom
##   (20 observations deleted due to missingness)
## Multiple R-squared:  0.01193,    Adjusted R-squared:  0.01089 
## F-statistic: 11.45 on 1 and 948 DF,  p-value: 0.0007459
5.1.2.1.3 Buffers 500m
ggplot(units::drop_units(bei_df), aes(x=Bike_lane_diff.2011.2016b500, y=wSCORESOC.2016)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(wSCORESOC.2016 ~ Bike_lane_diff.2011.2016b500, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = wSCORESOC.2016 ~ Bike_lane_diff.2011.2016b500, data = units::drop_units(bei_df))
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.087146 -0.021312  0.000382  0.021537  0.098092 
## 
## Coefficients:
##                               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                  1.488e-02  1.053e-03  14.130  < 2e-16 ***
## Bike_lane_diff.2011.2016b500 2.675e-06  4.278e-07   6.253 6.09e-10 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.02848 on 948 degrees of freedom
##   (20 observations deleted due to missingness)
## Multiple R-squared:  0.03961,    Adjusted R-squared:  0.0386 
## F-statistic:  39.1 on 1 and 948 DF,  p-value: 6.089e-10
5.1.2.1.4 Buffers 750m
ggplot(units::drop_units(bei_df), aes(x=Bike_lane_diff.2011.2016b750, y=wSCORESOC.2016)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(wSCORESOC.2016 ~ Bike_lane_diff.2011.2016b750, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = wSCORESOC.2016 ~ Bike_lane_diff.2011.2016b750, data = units::drop_units(bei_df))
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.089263 -0.020055  0.000102  0.020760  0.099702 
## 
## Coefficients:
##                               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                  1.327e-02  1.070e-03  12.398   <2e-16 ***
## Bike_lane_diff.2011.2016b750 2.573e-06  3.045e-07   8.449   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.02803 on 948 degrees of freedom
##   (20 observations deleted due to missingness)
## Multiple R-squared:  0.07003,    Adjusted R-squared:  0.06905 
## F-statistic: 71.38 on 1 and 948 DF,  p-value: < 2.2e-16

5.1.2.2 Bike lane / street

Measuring bike lane length change, normalized by length of streets within CT/buffers (in meters)

5.1.2.2.1 Census tract level
ggplot(units::drop_units(bei_df), aes(x=Bike_lane_diff.by.street.2011.2016ct, y=wSCORESOC.2016)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(wSCORESOC.2016 ~ Bike_lane_diff.by.street.2011.2016ct, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = wSCORESOC.2016 ~ Bike_lane_diff.by.street.2011.2016ct, 
##     data = units::drop_units(bei_df))
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.099465 -0.020801  0.003917  0.021838  0.091426 
## 
## Coefficients:
##                                       Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                          0.0215436  0.0011694  18.423  < 2e-16 ***
## Bike_lane_diff.by.street.2011.2016ct 0.0003846  0.0001129   3.407 0.000695 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.02896 on 702 degrees of freedom
##   (266 observations deleted due to missingness)
## Multiple R-squared:  0.01626,    Adjusted R-squared:  0.01486 
## F-statistic:  11.6 on 1 and 702 DF,  p-value: 0.0006954
5.1.2.2.2 Buffer 250m
ggplot(units::drop_units(bei_df), aes(x=Bike_lane_diff.by.street.2011.2016b250, y=wSCORESOC.2016)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(wSCORESOC.2016 ~ Bike_lane_diff.by.street.2011.2016b250, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = wSCORESOC.2016 ~ Bike_lane_diff.by.street.2011.2016b250, 
##     data = units::drop_units(bei_df))
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.085760 -0.020329  0.003543  0.020790  0.094580 
## 
## Coefficients:
##                                         Estimate Std. Error t value Pr(>|t|)
## (Intercept)                            0.0183891  0.0012090  15.210  < 2e-16
## Bike_lane_diff.by.street.2011.2016b250 0.0012432  0.0001769   7.027 4.91e-12
##                                           
## (Intercept)                            ***
## Bike_lane_diff.by.street.2011.2016b250 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.02832 on 721 degrees of freedom
##   (247 observations deleted due to missingness)
## Multiple R-squared:  0.06409,    Adjusted R-squared:  0.06279 
## F-statistic: 49.37 on 1 and 721 DF,  p-value: 4.906e-12
5.1.2.2.3 Buffer 500m
ggplot(units::drop_units(bei_df), aes(x=Bike_lane_diff.by.street.2011.2016b500, y=wSCORESOC.2016)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(wSCORESOC.2016 ~ Bike_lane_diff.by.street.2011.2016b500, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = wSCORESOC.2016 ~ Bike_lane_diff.by.street.2011.2016b500, 
##     data = units::drop_units(bei_df))
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.077409 -0.020433  0.002393  0.020354  0.096520 
## 
## Coefficients:
##                                        Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                            0.016449   0.001262  13.030  < 2e-16 ***
## Bike_lane_diff.by.street.2011.2016b500 0.001804   0.000216   8.354 3.36e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.02795 on 724 degrees of freedom
##   (244 observations deleted due to missingness)
## Multiple R-squared:  0.08791,    Adjusted R-squared:  0.08665 
## F-statistic: 69.78 on 1 and 724 DF,  p-value: 3.364e-16
5.1.2.2.4 Buffer 750m
ggplot(units::drop_units(bei_df), aes(x=Bike_lane_diff.by.street.2011.2016b750, y=wSCORESOC.2016)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(wSCORESOC.2016 ~ Bike_lane_diff.by.street.2011.2016b750, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = wSCORESOC.2016 ~ Bike_lane_diff.by.street.2011.2016b750, 
##     data = units::drop_units(bei_df))
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.081760 -0.019639  0.002058  0.019899  0.098165 
## 
## Coefficients:
##                                         Estimate Std. Error t value Pr(>|t|)
## (Intercept)                            0.0148036  0.0013035  11.357   <2e-16
## Bike_lane_diff.by.street.2011.2016b750 0.0022461  0.0002434   9.228   <2e-16
##                                           
## (Intercept)                            ***
## Bike_lane_diff.by.street.2011.2016b750 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.0277 on 731 degrees of freedom
##   (237 observations deleted due to missingness)
## Multiple R-squared:  0.1043, Adjusted R-squared:  0.1031 
## F-statistic: 85.16 on 1 and 731 DF,  p-value: < 2.2e-16

5.1.2.3 Bike lane / area

Measuring bike lane length change, normalized by area within CT/buffers (in meters)

5.1.2.3.1 Census tract level
ggplot(units::drop_units(bei_df), aes(x=Bike_lane_diff.by.area.2011.2016ct, y=wSCORESOC.2016)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(wSCORESOC.2016 ~ Bike_lane_diff.by.area.2011.2016ct, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = wSCORESOC.2016 ~ Bike_lane_diff.by.area.2011.2016ct, 
##     data = units::drop_units(bei_df))
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.073460 -0.021104  0.000026  0.019814  0.098300 
## 
## Coefficients:
##                                     Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                        0.0146689  0.0009759  15.031   <2e-16 ***
## Bike_lane_diff.by.area.2011.2016ct 0.0077844  0.0008513   9.144   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.02786 on 948 degrees of freedom
##   (20 observations deleted due to missingness)
## Multiple R-squared:  0.08105,    Adjusted R-squared:  0.08008 
## F-statistic: 83.61 on 1 and 948 DF,  p-value: < 2.2e-16
5.1.2.3.2 Buffer 250m
ggplot(units::drop_units(bei_df), aes(x=Bike_lane_diff.by.area.2011.2016b250, y=wSCORESOC.2016)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(wSCORESOC.2016 ~ Bike_lane_diff.by.area.2011.2016b250, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = wSCORESOC.2016 ~ Bike_lane_diff.by.area.2011.2016b250, 
##     data = units::drop_units(bei_df))
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.071772 -0.019890 -0.000031  0.019665  0.099988 
## 
## Coefficients:
##                                       Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                          0.0129809  0.0009795   13.25   <2e-16 ***
## Bike_lane_diff.by.area.2011.2016b250 0.0124400  0.0010557   11.78   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.02714 on 948 degrees of freedom
##   (20 observations deleted due to missingness)
## Multiple R-squared:  0.1278, Adjusted R-squared:  0.1268 
## F-statistic: 138.8 on 1 and 948 DF,  p-value: < 2.2e-16
5.1.2.3.3 Buffer 500m
ggplot(units::drop_units(bei_df), aes(x=Bike_lane_diff.by.area.2011.2016b500, y=wSCORESOC.2016)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(wSCORESOC.2016 ~ Bike_lane_diff.by.area.2011.2016b500, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = wSCORESOC.2016 ~ Bike_lane_diff.by.area.2011.2016b500, 
##     data = units::drop_units(bei_df))
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.072685 -0.019455 -0.000541  0.019379  0.101196 
## 
## Coefficients:
##                                       Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                          0.0117733  0.0009891   11.90   <2e-16 ***
## Bike_lane_diff.by.area.2011.2016b500 0.0159618  0.0012134   13.15   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.02673 on 948 degrees of freedom
##   (20 observations deleted due to missingness)
## Multiple R-squared:  0.1544, Adjusted R-squared:  0.1535 
## F-statistic:   173 on 1 and 948 DF,  p-value: < 2.2e-16
5.1.2.3.4 Buffer 750m
ggplot(units::drop_units(bei_df), aes(x=Bike_lane_diff.by.area.2011.2016b750, y=wSCORESOC.2016)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(wSCORESOC.2016 ~ Bike_lane_diff.by.area.2011.2016b750, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = wSCORESOC.2016 ~ Bike_lane_diff.by.area.2011.2016b750, 
##     data = units::drop_units(bei_df))
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.072425 -0.018691 -0.000239  0.018510  0.102041 
## 
## Coefficients:
##                                       Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                          0.0109278  0.0009971   10.96   <2e-16 ***
## Bike_lane_diff.by.area.2011.2016b750 0.0184641  0.0013187   14.00   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.02646 on 948 degrees of freedom
##   (20 observations deleted due to missingness)
## Multiple R-squared:  0.1714, Adjusted R-squared:  0.1705 
## F-statistic: 196.1 on 1 and 948 DF,  p-value: < 2.2e-16

5.1.2.4 Canopy change

Measuring canopy (i.e. greenness) ratio change within CT/buffer between 2011 and 2017 (in %)

5.1.2.4.1 Census tract level
ggplot(units::drop_units(bei_df), aes(x=pct_esp_vert_diff_2011.2017ct, y=wSCORESOC.2016)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(wSCORESOC.2016 ~ pct_esp_vert_diff_2011.2017ct, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = wSCORESOC.2016 ~ pct_esp_vert_diff_2011.2017ct, 
##     data = units::drop_units(bei_df))
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.077181 -0.022926 -0.000038  0.023861  0.094607 
## 
## Coefficients:
##                                 Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                    0.0187165  0.0012544  14.921   <2e-16 ***
## pct_esp_vert_diff_2011.2017ct -0.0001439  0.0001744  -0.825     0.41    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.02905 on 948 degrees of freedom
##   (20 observations deleted due to missingness)
## Multiple R-squared:  0.0007176,  Adjusted R-squared:  -0.0003365 
## F-statistic: 0.6808 on 1 and 948 DF,  p-value: 0.4095
5.1.2.4.2 Buffer 250m
ggplot(units::drop_units(bei_df), aes(x=pct_esp_vert_diff_2011.2017b250, y=wSCORESOC.2016)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(wSCORESOC.2016 ~ pct_esp_vert_diff_2011.2017b250, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = wSCORESOC.2016 ~ pct_esp_vert_diff_2011.2017b250, 
##     data = units::drop_units(bei_df))
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.074810 -0.022881  0.000216  0.024048  0.094711 
## 
## Coefficients:
##                                   Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                      0.0193741  0.0012646  15.320   <2e-16 ***
## pct_esp_vert_diff_2011.2017b250 -0.0002922  0.0001840  -1.588    0.113    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.02902 on 948 degrees of freedom
##   (20 observations deleted due to missingness)
## Multiple R-squared:  0.002653,   Adjusted R-squared:  0.001601 
## F-statistic: 2.522 on 1 and 948 DF,  p-value: 0.1126
5.1.2.4.3 Buffer 500m
ggplot(units::drop_units(bei_df), aes(x=pct_esp_vert_diff_2011.2017b500, y=wSCORESOC.2016)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(wSCORESOC.2016 ~ pct_esp_vert_diff_2011.2017b500, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = wSCORESOC.2016 ~ pct_esp_vert_diff_2011.2017b500, 
##     data = units::drop_units(bei_df))
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.074909 -0.022909  0.000083  0.023970  0.094889 
## 
## Coefficients:
##                                   Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                      0.0196867  0.0012774  15.411   <2e-16 ***
## pct_esp_vert_diff_2011.2017b500 -0.0003627  0.0001895  -1.914    0.056 .  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.02901 on 948 degrees of freedom
##   (20 observations deleted due to missingness)
## Multiple R-squared:  0.003849,   Adjusted R-squared:  0.002798 
## F-statistic: 3.663 on 1 and 948 DF,  p-value: 0.05595
5.1.2.4.4 Buffer 750m
ggplot(units::drop_units(bei_df), aes(x=pct_esp_vert_diff_2011.2017b750, y=wSCORESOC.2016)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(wSCORESOC.2016 ~ pct_esp_vert_diff_2011.2017b750, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = wSCORESOC.2016 ~ pct_esp_vert_diff_2011.2017b750, 
##     data = units::drop_units(bei_df))
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.07479 -0.02299 -0.00016  0.02398  0.09487 
## 
## Coefficients:
##                                   Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                      0.0200264  0.0012938  15.479   <2e-16 ***
## pct_esp_vert_diff_2011.2017b750 -0.0004397  0.0001961  -2.243   0.0251 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.02899 on 948 degrees of freedom
##   (20 observations deleted due to missingness)
## Multiple R-squared:  0.005279,   Adjusted R-squared:  0.004229 
## F-statistic: 5.031 on 1 and 948 DF,  p-value: 0.02513

5.1.3 Gentrified CT | 2016

5.1.3.1 Bike lane length

Measuring bike lane length change within CT/buffers (in meters) between 2011 and 2016

5.1.3.1.1 Census tract level
ggplot(drop_na(units::drop_units(bei_df), gentrified_2016_2011), aes(x=Bike_lane_diff.2011.2016ct, y=gentrified_2016_2011)) +
  geom_boxplot()

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(Bike_lane_diff.2011.2016ct, na.rm = TRUE),
    sd = sd(Bike_lane_diff.2011.2016ct, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(Bike_lane_diff.2011.2016ct ~ gentrified_2016_2011, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df    Sum Sq Mean Sq F value Pr(>F)
## gentrified_2016_2011   1    205247  205247   0.253  0.615
## Residuals            945 765953237  810533               
## 23 observations deleted due to missingness
5.1.3.1.2 Buffers 250m
ggplot(drop_na(units::drop_units(bei_df), gentrified_2016_2011), aes(x=Bike_lane_diff.2011.2016b250, y=gentrified_2016_2011)) +
  geom_boxplot()

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(Bike_lane_diff.2011.2016b250, na.rm = TRUE),
    sd = sd(Bike_lane_diff.2011.2016b250, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(Bike_lane_diff.2011.2016b250 ~ gentrified_2016_2011, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df    Sum Sq  Mean Sq F value   Pr(>F)    
## gentrified_2016_2011   1 2.977e+07 29772990   13.79 0.000216 ***
## Residuals            945 2.040e+09  2159034                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 23 observations deleted due to missingness
5.1.3.1.3 Buffers 500m
ggplot(drop_na(units::drop_units(bei_df), gentrified_2016_2011), aes(x=Bike_lane_diff.2011.2016b500, y=gentrified_2016_2011)) +
  geom_boxplot()

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(Bike_lane_diff.2011.2016b500, na.rm = TRUE),
    sd = sd(Bike_lane_diff.2011.2016b500, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(Bike_lane_diff.2011.2016b500 ~ gentrified_2016_2011, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df    Sum Sq   Mean Sq F value   Pr(>F)    
## gentrified_2016_2011   1 1.594e+08 159408890   35.28 4.01e-09 ***
## Residuals            945 4.270e+09   4518550                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 23 observations deleted due to missingness
5.1.3.1.4 Buffers 750m
ggplot(drop_na(units::drop_units(bei_df), gentrified_2016_2011), aes(x=Bike_lane_diff.2011.2016b750, y=gentrified_2016_2011)) +
  geom_boxplot()

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(Bike_lane_diff.2011.2016b750, na.rm = TRUE),
    sd = sd(Bike_lane_diff.2011.2016b750, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(Bike_lane_diff.2011.2016b750 ~ gentrified_2016_2011, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df    Sum Sq   Mean Sq F value   Pr(>F)    
## gentrified_2016_2011   1 4.517e+08 451658967   53.32 6.02e-13 ***
## Residuals            945 8.005e+09   8471075                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 23 observations deleted due to missingness

5.1.3.2 Bike lane / street

Measuring bike lane length change, normalized by length of streets within CT/buffers (in meters)

5.1.3.2.1 Census tract level
ggplot(drop_na(units::drop_units(bei_df), gentrified_2016_2011), aes(x=Bike_lane_diff.by.street.2011.2016ct, y=gentrified_2016_2011)) +
  geom_boxplot()
## Warning: Removed 244 rows containing non-finite values (stat_boxplot).

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(Bike_lane_diff.by.street.2011.2016ct, na.rm = TRUE),
    sd = sd(Bike_lane_diff.by.street.2011.2016ct, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(Bike_lane_diff.by.street.2011.2016ct ~ gentrified_2016_2011, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value  Pr(>F)   
## gentrified_2016_2011   1    784   784.4   8.461 0.00374 **
## Residuals            701  64986    92.7                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 267 observations deleted due to missingness
5.1.3.2.2 Buffers 250m
ggplot(drop_na(units::drop_units(bei_df), gentrified_2016_2011), aes(x=Bike_lane_diff.by.street.2011.2016b250, y=gentrified_2016_2011)) +
  geom_boxplot()
## Warning: Removed 225 rows containing non-finite values (stat_boxplot).

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(Bike_lane_diff.by.street.2011.2016b250, na.rm = TRUE),
    sd = sd(Bike_lane_diff.by.street.2011.2016b250, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(Bike_lane_diff.by.street.2011.2016b250 ~ gentrified_2016_2011, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value   Pr(>F)    
## gentrified_2016_2011   1   1172    1172   34.53 6.43e-09 ***
## Residuals            720  24449      34                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 248 observations deleted due to missingness
5.1.3.2.3 Buffers 500m
ggplot(drop_na(units::drop_units(bei_df), gentrified_2016_2011), aes(x=Bike_lane_diff.by.street.2011.2016b500, y=gentrified_2016_2011)) +
  geom_boxplot()
## Warning: Removed 222 rows containing non-finite values (stat_boxplot).

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(Bike_lane_diff.by.street.2011.2016b500, na.rm = TRUE),
    sd = sd(Bike_lane_diff.by.street.2011.2016b500, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(Bike_lane_diff.by.street.2011.2016b500 ~ gentrified_2016_2011, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value   Pr(>F)    
## gentrified_2016_2011   1   1045  1045.2   48.14 8.83e-12 ***
## Residuals            723  15697    21.7                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 245 observations deleted due to missingness
5.1.3.2.4 Buffers 750m
ggplot(drop_na(units::drop_units(bei_df), gentrified_2016_2011), aes(x=Bike_lane_diff.by.street.2011.2016b750, y=gentrified_2016_2011)) +
  geom_boxplot()
## Warning: Removed 215 rows containing non-finite values (stat_boxplot).

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(Bike_lane_diff.by.street.2011.2016b750, na.rm = TRUE),
    sd = sd(Bike_lane_diff.by.street.2011.2016b750, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(Bike_lane_diff.by.street.2011.2016b750 ~ gentrified_2016_2011, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value   Pr(>F)    
## gentrified_2016_2011   1    844   844.0   50.98 2.26e-12 ***
## Residuals            730  12086    16.6                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 238 observations deleted due to missingness

5.1.3.3 Bike lane / area

Measuring bike lane length change, normalized by area within CT/buffers (in meters)

5.1.3.3.1 Census tract level
ggplot(drop_na(units::drop_units(bei_df), gentrified_2016_2011), aes(x=Bike_lane_diff.by.area.2011.2016ct, y=gentrified_2016_2011)) +
  geom_boxplot()

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(Bike_lane_diff.by.area.2011.2016ct, na.rm = TRUE),
    sd = sd(Bike_lane_diff.by.area.2011.2016ct, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(Bike_lane_diff.by.area.2011.2016ct ~ gentrified_2016_2011, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value   Pr(>F)    
## gentrified_2016_2011   1   61.1   61.09    57.2 9.34e-14 ***
## Residuals            945 1009.3    1.07                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 23 observations deleted due to missingness
5.1.3.3.2 Buffers 250m
ggplot(drop_na(units::drop_units(bei_df), gentrified_2016_2011), aes(x=Bike_lane_diff.by.area.2011.2016b250, y=gentrified_2016_2011)) +
  geom_boxplot()

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(Bike_lane_diff.by.area.2011.2016b250, na.rm = TRUE),
    sd = sd(Bike_lane_diff.by.area.2011.2016b250, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(Bike_lane_diff.by.area.2011.2016b250 ~ gentrified_2016_2011, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value Pr(>F)    
## gentrified_2016_2011   1   66.9   66.86   106.4 <2e-16 ***
## Residuals            945  593.7    0.63                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 23 observations deleted due to missingness
5.1.3.3.3 Buffers 500m
ggplot(drop_na(units::drop_units(bei_df), gentrified_2016_2011), aes(x=Bike_lane_diff.by.area.2011.2016b500, y=gentrified_2016_2011)) +
  geom_boxplot()

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(Bike_lane_diff.by.area.2011.2016b500, na.rm = TRUE),
    sd = sd(Bike_lane_diff.by.area.2011.2016b500, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(Bike_lane_diff.by.area.2011.2016b500 ~ gentrified_2016_2011, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value Pr(>F)    
## gentrified_2016_2011   1   58.6   58.57   130.1 <2e-16 ***
## Residuals            945  425.3    0.45                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 23 observations deleted due to missingness
5.1.3.3.4 Buffers 750m
ggplot(drop_na(units::drop_units(bei_df), gentrified_2016_2011), aes(x=Bike_lane_diff.by.area.2011.2016b750, y=gentrified_2016_2011)) +
  geom_boxplot()

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(Bike_lane_diff.by.area.2011.2016b750, na.rm = TRUE),
    sd = sd(Bike_lane_diff.by.area.2011.2016b750, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(Bike_lane_diff.by.area.2011.2016b750 ~ gentrified_2016_2011, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value Pr(>F)    
## gentrified_2016_2011   1   49.0   49.05   131.7 <2e-16 ***
## Residuals            945  351.9    0.37                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 23 observations deleted due to missingness

5.1.3.4 Canopy change

5.1.3.4.1 Census tract level
ggplot(drop_na(units::drop_units(bei_df), gentrified_2016_2011), aes(x=pct_esp_vert_diff_2011.2017ct, y=gentrified_2016_2011)) +
  geom_boxplot() 

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_diff_2011.2017ct, na.rm = TRUE),
    sd = sd(pct_esp_vert_diff_2011.2017ct, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_diff_2011.2017ct ~ gentrified_2016_2011, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value Pr(>F)
## gentrified_2016_2011   1      0   0.033   0.001  0.973
## Residuals            945  27144  28.724               
## 23 observations deleted due to missingness
5.1.3.4.2 Buffer 250m
ggplot(drop_na(units::drop_units(bei_df), gentrified_2016_2011), aes(x=pct_esp_vert_diff_2011.2017b250, y=gentrified_2016_2011)) +
  geom_boxplot() 

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_diff_2011.2017b250, na.rm = TRUE),
    sd = sd(pct_esp_vert_diff_2011.2017b250, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_diff_2011.2017b250 ~ gentrified_2016_2011, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value Pr(>F)
## gentrified_2016_2011   1      6    5.94   0.232   0.63
## Residuals            945  24218   25.63               
## 23 observations deleted due to missingness
5.1.3.4.3 Buffer 500m
ggplot(drop_na(units::drop_units(bei_df), gentrified_2016_2011), aes(x=pct_esp_vert_diff_2011.2017b500, y=gentrified_2016_2011)) +
  geom_boxplot() 

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_diff_2011.2017b500, na.rm = TRUE),
    sd = sd(pct_esp_vert_diff_2011.2017b500, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_diff_2011.2017b500 ~ gentrified_2016_2011, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value Pr(>F)
## gentrified_2016_2011   1      6   5.686   0.236  0.627
## Residuals            945  22742  24.066               
## 23 observations deleted due to missingness
5.1.3.4.4 Buffer 750m
ggplot(drop_na(units::drop_units(bei_df), gentrified_2016_2011), aes(x=pct_esp_vert_diff_2011.2017b750, y=gentrified_2016_2011)) +
  geom_boxplot() 

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_diff_2011.2017b750, na.rm = TRUE),
    sd = sd(pct_esp_vert_diff_2011.2017b750, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_diff_2011.2017b750 ~ gentrified_2016_2011, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value Pr(>F)
## gentrified_2016_2011   1     11   10.83   0.484  0.487
## Residuals            945  21143   22.37               
## 23 observations deleted due to missingness

5.1.4 Gentrified CT | 2011

5.1.4.1 Bike lane length

Measuring bike lane length change within CT/buffers (in meters) between 2011 and 2016 (and not between 2006 and 2011)

5.1.4.1.1 Census tract level
ggplot(drop_na(units::drop_units(bei_df), gentrified_2011_2006), aes(x=Bike_lane_diff.2011.2016ct, y=gentrified_2011_2006)) +
  geom_boxplot() 

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2011_2006) %>%
  summarise(
    count = n(),
    mean = mean(Bike_lane_diff.2011.2016ct, na.rm = TRUE),
    sd = sd(Bike_lane_diff.2011.2016ct, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(Bike_lane_diff.2011.2016ct ~ gentrified_2011_2006, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df    Sum Sq Mean Sq F value Pr(>F)
## gentrified_2011_2006   1    691401  691401   0.805   0.37
## Residuals            886 760756987  858642               
## 82 observations deleted due to missingness
5.1.4.1.2 Buffers 250m
ggplot(drop_na(units::drop_units(bei_df), gentrified_2011_2006), aes(x=Bike_lane_diff.2011.2016b250, y=gentrified_2011_2006)) +
  geom_boxplot()

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2011_2006) %>%
  summarise(
    count = n(),
    mean = mean(Bike_lane_diff.2011.2016b250, na.rm = TRUE),
    sd = sd(Bike_lane_diff.2011.2016b250, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(Bike_lane_diff.2011.2016b250 ~ gentrified_2011_2006, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df    Sum Sq  Mean Sq F value   Pr(>F)    
## gentrified_2011_2006   1 3.867e+07 38666795   17.08 3.92e-05 ***
## Residuals            886 2.005e+09  2263514                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 82 observations deleted due to missingness
5.1.4.1.3 Buffers 500m
ggplot(drop_na(units::drop_units(bei_df), gentrified_2011_2006), aes(x=Bike_lane_diff.2011.2016b500, y=gentrified_2011_2006)) +
  geom_boxplot()

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2011_2006) %>%
  summarise(
    count = n(),
    mean = mean(Bike_lane_diff.2011.2016b500, na.rm = TRUE),
    sd = sd(Bike_lane_diff.2011.2016b500, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(Bike_lane_diff.2011.2016b500 ~ gentrified_2011_2006, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df    Sum Sq   Mean Sq F value  Pr(>F)    
## gentrified_2011_2006   1 1.625e+08 162483870   34.41 6.3e-09 ***
## Residuals            886 4.184e+09   4722050                    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 82 observations deleted due to missingness
5.1.4.1.4 Buffers 750m
ggplot(drop_na(units::drop_units(bei_df), gentrified_2011_2006), aes(x=Bike_lane_diff.2011.2016b750, y=gentrified_2011_2006)) +
  geom_boxplot()

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2011_2006) %>%
  summarise(
    count = n(),
    mean = mean(Bike_lane_diff.2011.2016b750, na.rm = TRUE),
    sd = sd(Bike_lane_diff.2011.2016b750, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(Bike_lane_diff.2011.2016b750 ~ gentrified_2011_2006, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df    Sum Sq   Mean Sq F value   Pr(>F)    
## gentrified_2011_2006   1 5.376e+08 537556297   61.72 1.14e-14 ***
## Residuals            886 7.717e+09   8709779                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 82 observations deleted due to missingness

5.1.4.2 Canopy change

5.1.4.2.1 Census tract level
ggplot(drop_na(units::drop_units(bei_df), gentrified_2011_2006), aes(x=pct_esp_vert_diff_2011.2017ct, y=gentrified_2011_2006)) +
  geom_boxplot() 

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2011_2006) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_diff_2011.2017ct, na.rm = TRUE),
    sd = sd(pct_esp_vert_diff_2011.2017ct, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_diff_2011.2017ct ~ gentrified_2011_2006, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value Pr(>F)
## gentrified_2011_2006   1      6   5.501   0.193  0.661
## Residuals            886  25317  28.575               
## 82 observations deleted due to missingness
5.1.4.2.2 Buffer 250m
ggplot(drop_na(units::drop_units(bei_df), gentrified_2011_2006), aes(x=pct_esp_vert_diff_2011.2017b250, y=gentrified_2011_2006)) +
  geom_boxplot() 

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2011_2006) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_diff_2011.2017b250, na.rm = TRUE),
    sd = sd(pct_esp_vert_diff_2011.2017b250, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_diff_2011.2017b250 ~ gentrified_2011_2006, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value Pr(>F)
## gentrified_2011_2006   1      1   1.239   0.059  0.809
## Residuals            886  18707  21.114               
## 82 observations deleted due to missingness
5.1.4.2.3 Buffer 500m
ggplot(drop_na(units::drop_units(bei_df), gentrified_2011_2006), aes(x=pct_esp_vert_diff_2011.2017b500, y=gentrified_2011_2006)) +
  geom_boxplot() 

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2011_2006) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_diff_2011.2017b500, na.rm = TRUE),
    sd = sd(pct_esp_vert_diff_2011.2017b500, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_diff_2011.2017b500 ~ gentrified_2011_2006, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value Pr(>F)
## gentrified_2011_2006   1      6   5.608   0.283  0.595
## Residuals            886  17533  19.789               
## 82 observations deleted due to missingness
5.1.4.2.4 Buffer 750m
ggplot(drop_na(units::drop_units(bei_df), gentrified_2011_2006), aes(x=pct_esp_vert_diff_2011.2017b750, y=gentrified_2011_2006)) +
  geom_boxplot() 

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2011_2006) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_diff_2011.2017b750, na.rm = TRUE),
    sd = sd(pct_esp_vert_diff_2011.2017b750, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_diff_2011.2017b750 ~ gentrified_2011_2006, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value Pr(>F)
## gentrified_2011_2006   1     13   12.67    0.67  0.413
## Residuals            886  16750   18.91               
## 82 observations deleted due to missingness

5.1.5 Gentrified CT | 2006

5.1.5.1 Bike lane length

Measuring bike lane length change within CT/buffers (in meters) between 2011 and 2016 (and not between 2001 and 2006)

5.1.5.1.1 Census tract level
ggplot(drop_na(units::drop_units(bei_df), gentrified_2006_2001), aes(x=Bike_lane_diff.2011.2016ct, y=gentrified_2006_2001)) +
  geom_boxplot() 

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2006_2001) %>%
  summarise(
    count = n(),
    mean = mean(Bike_lane_diff.2011.2016ct, na.rm = TRUE),
    sd = sd(Bike_lane_diff.2011.2016ct, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(Bike_lane_diff.2011.2016ct ~ gentrified_2006_2001, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df    Sum Sq Mean Sq F value Pr(>F)  
## gentrified_2006_2001   1   1629828 1629828   3.598 0.0582 .
## Residuals            802 363318022  453015                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 166 observations deleted due to missingness
5.1.5.1.2 Buffers 250m
ggplot(drop_na(units::drop_units(bei_df), gentrified_2006_2001), aes(x=Bike_lane_diff.2011.2016b250, y=gentrified_2006_2001)) +
  geom_boxplot()

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2006_2001) %>%
  summarise(
    count = n(),
    mean = mean(Bike_lane_diff.2011.2016b250, na.rm = TRUE),
    sd = sd(Bike_lane_diff.2011.2016b250, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(Bike_lane_diff.2011.2016b250 ~ gentrified_2006_2001, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df   Sum Sq  Mean Sq F value   Pr(>F)    
## gentrified_2006_2001   1 5.52e+07 55201554   40.24 3.74e-10 ***
## Residuals            802 1.10e+09  1371697                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 166 observations deleted due to missingness
5.1.5.1.3 Buffers 500m
ggplot(drop_na(units::drop_units(bei_df), gentrified_2006_2001), aes(x=Bike_lane_diff.2011.2016b500, y=gentrified_2006_2001)) +
  geom_boxplot()

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2006_2001) %>%
  summarise(
    count = n(),
    mean = mean(Bike_lane_diff.2011.2016b500, na.rm = TRUE),
    sd = sd(Bike_lane_diff.2011.2016b500, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(Bike_lane_diff.2011.2016b500 ~ gentrified_2006_2001, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df    Sum Sq   Mean Sq F value Pr(>F)    
## gentrified_2006_2001   1 2.423e+08 242253012   71.08 <2e-16 ***
## Residuals            802 2.733e+09   3408209                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 166 observations deleted due to missingness
5.1.5.1.4 Buffers 750m
ggplot(drop_na(units::drop_units(bei_df), gentrified_2006_2001), aes(x=Bike_lane_diff.2011.2016b750, y=gentrified_2006_2001)) +
  geom_boxplot()

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2006_2001) %>%
  summarise(
    count = n(),
    mean = mean(Bike_lane_diff.2011.2016b750, na.rm = TRUE),
    sd = sd(Bike_lane_diff.2011.2016b750, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(Bike_lane_diff.2011.2016b750 ~ gentrified_2006_2001, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df    Sum Sq   Mean Sq F value Pr(>F)    
## gentrified_2006_2001   1 7.300e+08 729955328   105.4 <2e-16 ***
## Residuals            802 5.555e+09   6926433                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 166 observations deleted due to missingness

5.1.5.2 Canopy change

5.1.5.2.1 Census tract level
ggplot(drop_na(units::drop_units(bei_df), gentrified_2006_2001), aes(x=pct_esp_vert_diff_2011.2017ct, y=gentrified_2006_2001)) +
  geom_boxplot() 

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2006_2001) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_diff_2011.2017ct, na.rm = TRUE),
    sd = sd(pct_esp_vert_diff_2011.2017ct, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_diff_2011.2017ct ~ gentrified_2006_2001, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value Pr(>F)
## gentrified_2006_2001   1     11   11.04   0.431  0.512
## Residuals            802  20533   25.60               
## 166 observations deleted due to missingness
5.1.5.2.2 Buffer 250m
ggplot(drop_na(units::drop_units(bei_df), gentrified_2006_2001), aes(x=pct_esp_vert_diff_2011.2017b250, y=gentrified_2006_2001)) +
  geom_boxplot() 

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2006_2001) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_diff_2011.2017b250, na.rm = TRUE),
    sd = sd(pct_esp_vert_diff_2011.2017b250, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_diff_2011.2017b250 ~ gentrified_2006_2001, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value Pr(>F)
## gentrified_2006_2001   1     14   13.97   0.718  0.397
## Residuals            802  15612   19.47               
## 166 observations deleted due to missingness
5.1.5.2.3 Buffer 500m
ggplot(drop_na(units::drop_units(bei_df), gentrified_2006_2001), aes(x=pct_esp_vert_diff_2011.2017b500, y=gentrified_2006_2001)) +
  geom_boxplot() 

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2006_2001) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_diff_2011.2017b500, na.rm = TRUE),
    sd = sd(pct_esp_vert_diff_2011.2017b500, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_diff_2011.2017b500 ~ gentrified_2006_2001, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value Pr(>F)
## gentrified_2006_2001   1      7   7.197   0.394  0.531
## Residuals            802  14667  18.288               
## 166 observations deleted due to missingness
5.1.5.2.4 Buffer 750m
ggplot(drop_na(units::drop_units(bei_df), gentrified_2006_2001), aes(x=pct_esp_vert_diff_2011.2017b750, y=gentrified_2006_2001)) +
  geom_boxplot() 

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2006_2001) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_diff_2011.2017b750, na.rm = TRUE),
    sd = sd(pct_esp_vert_diff_2011.2017b750, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_diff_2011.2017b750 ~ gentrified_2006_2001, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value Pr(>F)
## gentrified_2006_2001   1      1    0.64   0.036  0.849
## Residuals            802  14179   17.68               
## 166 observations deleted due to missingness

5.2 Association between outcomes and independant variables | INTERACT study area

# keep only interact CT
bei_df_aoi <- filter(bei_df, interact_aoi)

5.2.1 Pampalon | material vs. BEI

5.2.1.1 Bike lane length

Measuring bike lane length change within CT/buffers (in meters) between 2011 and 2016

5.2.1.1.1 Census tract level
ggplot(units::drop_units(bei_df_aoi), aes(x=Bike_lane_diff.2011.2016ct, y=wSCOREMAT.2016)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(wSCOREMAT.2016 ~ Bike_lane_diff.2011.2016ct, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = wSCOREMAT.2016 ~ Bike_lane_diff.2011.2016ct, data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.142085 -0.024870  0.001266  0.026881  0.137334 
## 
## Coefficients:
##                              Estimate Std. Error t value Pr(>|t|)  
## (Intercept)                 1.543e-03  1.605e-03   0.961   0.3368  
## Bike_lane_diff.2011.2016ct -3.559e-06  1.462e-06  -2.434   0.0152 *
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.03979 on 689 degrees of freedom
##   (14 observations deleted due to missingness)
## Multiple R-squared:  0.008529,   Adjusted R-squared:  0.00709 
## F-statistic: 5.927 on 1 and 689 DF,  p-value: 0.01517
5.2.1.1.2 Buffers 250m
ggplot(units::drop_units(bei_df_aoi), aes(x=Bike_lane_diff.2011.2016b250, y=wSCOREMAT.2016)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(wSCOREMAT.2016 ~ Bike_lane_diff.2011.2016b250, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = wSCOREMAT.2016 ~ Bike_lane_diff.2011.2016b250, data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.143165 -0.025609  0.002509  0.026293  0.136254 
## 
## Coefficients:
##                                Estimate Std. Error t value Pr(>|t|)   
## (Intercept)                   2.623e-03  1.716e-03   1.528  0.12694   
## Bike_lane_diff.2011.2016b250 -2.651e-06  9.069e-07  -2.924  0.00357 **
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.03972 on 689 degrees of freedom
##   (14 observations deleted due to missingness)
## Multiple R-squared:  0.01225,    Adjusted R-squared:  0.01082 
## F-statistic: 8.547 on 1 and 689 DF,  p-value: 0.003574
5.2.1.1.3 Buffers 500m
ggplot(units::drop_units(bei_df_aoi), aes(x=Bike_lane_diff.2011.2016b500, y=wSCOREMAT.2016)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(wSCOREMAT.2016 ~ Bike_lane_diff.2011.2016b500, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = wSCOREMAT.2016 ~ Bike_lane_diff.2011.2016b500, data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.144252 -0.025817  0.001971  0.026545  0.135167 
## 
## Coefficients:
##                                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                   3.710e-03  1.819e-03   2.039 0.041793 *  
## Bike_lane_diff.2011.2016b500 -2.151e-06  6.312e-07  -3.407 0.000694 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.03963 on 689 degrees of freedom
##   (14 observations deleted due to missingness)
## Multiple R-squared:  0.01657,    Adjusted R-squared:  0.01515 
## F-statistic: 11.61 on 1 and 689 DF,  p-value: 0.0006938
5.2.1.1.4 Buffers 750m
ggplot(units::drop_units(bei_df_aoi), aes(x=Bike_lane_diff.2011.2016b750, y=wSCOREMAT.2016)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(wSCOREMAT.2016 ~ Bike_lane_diff.2011.2016b750, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = wSCOREMAT.2016 ~ Bike_lane_diff.2011.2016b750, data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.14482 -0.02576  0.00209  0.02703  0.13460 
## 
## Coefficients:
##                                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                   4.274e-03  1.911e-03   2.236 0.025643 *  
## Bike_lane_diff.2011.2016b750 -1.594e-06  4.645e-07  -3.432 0.000634 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.03962 on 689 degrees of freedom
##   (14 observations deleted due to missingness)
## Multiple R-squared:  0.01681,    Adjusted R-squared:  0.01538 
## F-statistic: 11.78 on 1 and 689 DF,  p-value: 0.0006341

5.2.1.2 Bike lane / street

Measuring bike lane length change, normalized by length of streets within CT/buffers (in meters)

5.2.1.2.1 Census tract level
ggplot(units::drop_units(bei_df_aoi), aes(x=Bike_lane_diff.by.street.2011.2016ct, y=wSCOREMAT.2016)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(wSCOREMAT.2016 ~ Bike_lane_diff.by.street.2011.2016ct, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = wSCOREMAT.2016 ~ Bike_lane_diff.by.street.2011.2016ct, 
##     data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.141912 -0.025419  0.001723  0.026550  0.137507 
## 
## Coefficients:
##                                        Estimate Std. Error t value Pr(>|t|)
## (Intercept)                           0.0013695  0.0017044   0.804    0.422
## Bike_lane_diff.by.street.2011.2016ct -0.0003076  0.0002114  -1.455    0.146
## 
## Residual standard error: 0.0399 on 689 degrees of freedom
##   (14 observations deleted due to missingness)
## Multiple R-squared:  0.003064,   Adjusted R-squared:  0.001617 
## F-statistic: 2.118 on 1 and 689 DF,  p-value: 0.1461
5.2.1.2.2 Buffer 250m
ggplot(units::drop_units(bei_df_aoi), aes(x=Bike_lane_diff.by.street.2011.2016b250, y=wSCOREMAT.2016)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(wSCOREMAT.2016 ~ Bike_lane_diff.by.street.2011.2016b250, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = wSCOREMAT.2016 ~ Bike_lane_diff.by.street.2011.2016b250, 
##     data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.143191 -0.025638  0.002861  0.026222  0.136228 
## 
## Coefficients:
##                                          Estimate Std. Error t value Pr(>|t|)  
## (Intercept)                             0.0026491  0.0017911   1.479   0.1396  
## Bike_lane_diff.by.street.2011.2016b250 -0.0006974  0.0002775  -2.513   0.0122 *
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.03978 on 689 degrees of freedom
##   (14 observations deleted due to missingness)
## Multiple R-squared:  0.009083,   Adjusted R-squared:  0.007645 
## F-statistic: 6.316 on 1 and 689 DF,  p-value: 0.01219
5.2.1.2.3 Buffer 500m
ggplot(units::drop_units(bei_df_aoi), aes(x=Bike_lane_diff.by.street.2011.2016b500, y=wSCOREMAT.2016)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(wSCOREMAT.2016 ~ Bike_lane_diff.by.street.2011.2016b500, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = wSCOREMAT.2016 ~ Bike_lane_diff.by.street.2011.2016b500, 
##     data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.143997 -0.026054  0.002716  0.026615  0.135422 
## 
## Coefficients:
##                                          Estimate Std. Error t value Pr(>|t|)
## (Intercept)                             0.0034549  0.0018726   1.845  0.06547
## Bike_lane_diff.by.street.2011.2016b500 -0.0009344  0.0003216  -2.905  0.00379
##                                          
## (Intercept)                            . 
## Bike_lane_diff.by.street.2011.2016b500 **
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.03972 on 689 degrees of freedom
##   (14 observations deleted due to missingness)
## Multiple R-squared:  0.0121, Adjusted R-squared:  0.01067 
## F-statistic:  8.44 on 1 and 689 DF,  p-value: 0.003787
5.2.1.2.4 Buffer 750m
ggplot(units::drop_units(bei_df_aoi), aes(x=Bike_lane_diff.by.street.2011.2016b750, y=wSCOREMAT.2016)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(wSCOREMAT.2016 ~ Bike_lane_diff.by.street.2011.2016b750, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = wSCOREMAT.2016 ~ Bike_lane_diff.by.street.2011.2016b750, 
##     data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.144234 -0.025710  0.003126  0.027081  0.135185 
## 
## Coefficients:
##                                          Estimate Std. Error t value Pr(>|t|)
## (Intercept)                             0.0036914  0.0019482   1.895  0.05855
## Bike_lane_diff.by.street.2011.2016b750 -0.0010041  0.0003577  -2.807  0.00514
##                                          
## (Intercept)                            . 
## Bike_lane_diff.by.street.2011.2016b750 **
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.03973 on 689 degrees of freedom
##   (14 observations deleted due to missingness)
## Multiple R-squared:  0.01131,    Adjusted R-squared:  0.009871 
## F-statistic: 7.879 on 1 and 689 DF,  p-value: 0.005143

5.2.1.3 Bike lane / area

Measuring bike lane length change, normalized by area within CT/buffers (in meters)

5.2.1.3.1 Census tract level
ggplot(units::drop_units(bei_df_aoi), aes(x=Bike_lane_diff.by.area.2011.2016ct, y=wSCOREMAT.2016)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(wSCOREMAT.2016 ~ Bike_lane_diff.by.area.2011.2016ct, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = wSCOREMAT.2016 ~ Bike_lane_diff.by.area.2011.2016ct, 
##     data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.141512 -0.025490  0.001817  0.026904  0.137906 
## 
## Coefficients:
##                                      Estimate Std. Error t value Pr(>|t|)
## (Intercept)                         0.0009702  0.0016937   0.573    0.567
## Bike_lane_diff.by.area.2011.2016ct -0.0012264  0.0012601  -0.973    0.331
## 
## Residual standard error: 0.03993 on 689 degrees of freedom
##   (14 observations deleted due to missingness)
## Multiple R-squared:  0.001373,   Adjusted R-squared:  -7.641e-05 
## F-statistic: 0.9473 on 1 and 689 DF,  p-value: 0.3308
5.2.1.3.2 Buffer 250m
ggplot(units::drop_units(bei_df_aoi), aes(x=Bike_lane_diff.by.area.2011.2016b250, y=wSCOREMAT.2016)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(wSCOREMAT.2016 ~ Bike_lane_diff.by.area.2011.2016b250, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = wSCOREMAT.2016 ~ Bike_lane_diff.by.area.2011.2016b250, 
##     data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.143015 -0.025663  0.002708  0.026574  0.136404 
## 
## Coefficients:
##                                       Estimate Std. Error t value Pr(>|t|)  
## (Intercept)                           0.002473   0.001764   1.402   0.1613  
## Bike_lane_diff.by.area.2011.2016b250 -0.003997   0.001621  -2.466   0.0139 *
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.03979 on 689 degrees of freedom
##   (14 observations deleted due to missingness)
## Multiple R-squared:  0.008746,   Adjusted R-squared:  0.007308 
## F-statistic: 6.079 on 1 and 689 DF,  p-value: 0.01392
5.2.1.3.3 Buffer 500m
ggplot(units::drop_units(bei_df_aoi), aes(x=Bike_lane_diff.by.area.2011.2016b500, y=wSCOREMAT.2016)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(wSCOREMAT.2016 ~ Bike_lane_diff.by.area.2011.2016b500, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = wSCOREMAT.2016 ~ Bike_lane_diff.by.area.2011.2016b500, 
##     data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.14380 -0.02586  0.00240  0.02701  0.13561 
## 
## Coefficients:
##                                       Estimate Std. Error t value Pr(>|t|)   
## (Intercept)                           0.003263   0.001829   1.784   0.0749 . 
## Bike_lane_diff.by.area.2011.2016b500 -0.005608   0.001914  -2.931   0.0035 **
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.03971 on 689 degrees of freedom
##   (14 observations deleted due to missingness)
## Multiple R-squared:  0.01231,    Adjusted R-squared:  0.01088 
## F-statistic: 8.588 on 1 and 689 DF,  p-value: 0.003496
5.2.1.3.4 Buffer 750m
ggplot(units::drop_units(bei_df_aoi), aes(x=Bike_lane_diff.by.area.2011.2016b750, y=wSCOREMAT.2016)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(wSCOREMAT.2016 ~ Bike_lane_diff.by.area.2011.2016b750, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = wSCOREMAT.2016 ~ Bike_lane_diff.by.area.2011.2016b750, 
##     data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.14410 -0.02554  0.00260  0.02712  0.13532 
## 
## Coefficients:
##                                       Estimate Std. Error t value Pr(>|t|)   
## (Intercept)                           0.003555   0.001881   1.890  0.05924 . 
## Bike_lane_diff.by.area.2011.2016b750 -0.006271   0.002122  -2.955  0.00323 **
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.03971 on 689 degrees of freedom
##   (14 observations deleted due to missingness)
## Multiple R-squared:  0.01252,    Adjusted R-squared:  0.01108 
## F-statistic: 8.734 on 1 and 689 DF,  p-value: 0.00323

5.2.1.4 Canopy change

Measuring canopy (i.e. greenness) ratio change within CT/buffer between 2011 and 2017 (in %)

5.2.1.4.1 Census tract level
ggplot(units::drop_units(bei_df_aoi), aes(x=pct_esp_vert_diff_2011.2017ct, y=wSCOREMAT.2016)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(wSCOREMAT.2016 ~ pct_esp_vert_diff_2011.2017ct, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = wSCOREMAT.2016 ~ pct_esp_vert_diff_2011.2017ct, 
##     data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.141301 -0.026512  0.001512  0.027090  0.141804 
## 
## Coefficients:
##                                 Estimate Std. Error t value Pr(>|t|)
## (Intercept)                    0.0015075  0.0023928   0.630    0.529
## pct_esp_vert_diff_2011.2017ct -0.0003044  0.0004443  -0.685    0.494
## 
## Residual standard error: 0.03995 on 689 degrees of freedom
##   (14 observations deleted due to missingness)
## Multiple R-squared:  0.0006807,  Adjusted R-squared:  -0.0007697 
## F-statistic: 0.4693 on 1 and 689 DF,  p-value: 0.4935
5.2.1.4.2 Buffer 250m
ggplot(units::drop_units(bei_df_aoi), aes(x=pct_esp_vert_diff_2011.2017b250, y=wSCOREMAT.2016)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(wSCOREMAT.2016 ~ pct_esp_vert_diff_2011.2017b250, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = wSCOREMAT.2016 ~ pct_esp_vert_diff_2011.2017b250, 
##     data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.140912 -0.026055  0.001444  0.026847  0.139639 
## 
## Coefficients:
##                                   Estimate Std. Error t value Pr(>|t|)  
## (Intercept)                      0.0040645  0.0025479   1.595   0.1111  
## pct_esp_vert_diff_2011.2017b250 -0.0009673  0.0005180  -1.867   0.0623 .
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.03986 on 689 degrees of freedom
##   (14 observations deleted due to missingness)
## Multiple R-squared:  0.005035,   Adjusted R-squared:  0.003591 
## F-statistic: 3.486 on 1 and 689 DF,  p-value: 0.0623
5.2.1.4.3 Buffer 500m
ggplot(units::drop_units(bei_df_aoi), aes(x=pct_esp_vert_diff_2011.2017b500, y=wSCOREMAT.2016)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(wSCOREMAT.2016 ~ pct_esp_vert_diff_2011.2017b500, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = wSCOREMAT.2016 ~ pct_esp_vert_diff_2011.2017b500, 
##     data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.140252 -0.025600  0.001226  0.026962  0.139502 
## 
## Coefficients:
##                                   Estimate Std. Error t value Pr(>|t|)  
## (Intercept)                      0.0040793  0.0026421   1.544   0.1231  
## pct_esp_vert_diff_2011.2017b500 -0.0009862  0.0005559  -1.774   0.0765 .
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.03987 on 689 degrees of freedom
##   (14 observations deleted due to missingness)
## Multiple R-squared:  0.004547,   Adjusted R-squared:  0.003103 
## F-statistic: 3.147 on 1 and 689 DF,  p-value: 0.07649
5.2.1.4.4 Buffer 750m
ggplot(units::drop_units(bei_df_aoi), aes(x=pct_esp_vert_diff_2011.2017b750, y=wSCOREMAT.2016)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(wSCOREMAT.2016 ~ pct_esp_vert_diff_2011.2017b750, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = wSCOREMAT.2016 ~ pct_esp_vert_diff_2011.2017b750, 
##     data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.140111 -0.026318  0.001616  0.026562  0.139369 
## 
## Coefficients:
##                                   Estimate Std. Error t value Pr(>|t|)  
## (Intercept)                      0.0049083  0.0026849   1.828   0.0680 .
## pct_esp_vert_diff_2011.2017b750 -0.0012163  0.0005777  -2.106   0.0356 *
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.03983 on 689 degrees of freedom
##   (14 observations deleted due to missingness)
## Multiple R-squared:  0.006394,   Adjusted R-squared:  0.004952 
## F-statistic: 4.434 on 1 and 689 DF,  p-value: 0.03559

5.2.2 Pampalon | social vs. BEI

5.2.2.1 Bike lane length

Measuring bike lane length change within CT/buffers (in meters) between 2011 and 2016

5.2.2.1.1 Census tract level
ggplot(units::drop_units(bei_df_aoi), aes(x=Bike_lane_diff.2011.2016ct, y=wSCORESOC.2016)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(wSCORESOC.2016 ~ Bike_lane_diff.2011.2016ct, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = wSCORESOC.2016 ~ Bike_lane_diff.2011.2016ct, data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.077632 -0.020726  0.002851  0.023379  0.088820 
## 
## Coefficients:
##                              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                 2.415e-02  1.173e-03  20.593   <2e-16 ***
## Bike_lane_diff.2011.2016ct -2.085e-06  1.068e-06  -1.953   0.0513 .  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.02907 on 689 degrees of freedom
##   (14 observations deleted due to missingness)
## Multiple R-squared:  0.005504,   Adjusted R-squared:  0.00406 
## F-statistic: 3.813 on 1 and 689 DF,  p-value: 0.05126
5.2.2.1.2 Buffers 250m
ggplot(units::drop_units(bei_df_aoi), aes(x=Bike_lane_diff.2011.2016b250, y=wSCORESOC.2016)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(wSCORESOC.2016 ~ Bike_lane_diff.2011.2016b250, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = wSCORESOC.2016 ~ Bike_lane_diff.2011.2016b250, data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.076323 -0.020636  0.003626  0.023255  0.090129 
## 
## Coefficients:
##                               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                  2.284e-02  1.259e-03  18.142   <2e-16 ***
## Bike_lane_diff.2011.2016b250 6.078e-07  6.651e-07   0.914    0.361    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.02913 on 689 degrees of freedom
##   (14 observations deleted due to missingness)
## Multiple R-squared:  0.001211,   Adjusted R-squared:  -0.000239 
## F-statistic: 0.8351 on 1 and 689 DF,  p-value: 0.3611
5.2.2.1.3 Buffers 500m
ggplot(units::drop_units(bei_df_aoi), aes(x=Bike_lane_diff.2011.2016b500, y=wSCORESOC.2016)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(wSCORESOC.2016 ~ Bike_lane_diff.2011.2016b500, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = wSCORESOC.2016 ~ Bike_lane_diff.2011.2016b500, data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.075316 -0.020362  0.003956  0.022246  0.092087 
## 
## Coefficients:
##                               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                  2.088e-02  1.327e-03  15.737  < 2e-16 ***
## Bike_lane_diff.2011.2016b500 1.553e-06  4.605e-07   3.372 0.000788 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.02891 on 689 degrees of freedom
##   (14 observations deleted due to missingness)
## Multiple R-squared:  0.01624,    Adjusted R-squared:  0.01481 
## F-statistic: 11.37 on 1 and 689 DF,  p-value: 0.0007877
5.2.2.1.4 Buffers 750m
ggplot(units::drop_units(bei_df_aoi), aes(x=Bike_lane_diff.2011.2016b750, y=wSCORESOC.2016)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(wSCORESOC.2016 ~ Bike_lane_diff.2011.2016b750, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = wSCORESOC.2016 ~ Bike_lane_diff.2011.2016b750, data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.07989 -0.02017  0.00368  0.02173  0.09403 
## 
## Coefficients:
##                               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                  1.894e-02  1.379e-03  13.738  < 2e-16 ***
## Bike_lane_diff.2011.2016b750 1.758e-06  3.350e-07   5.247 2.06e-07 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.02858 on 689 degrees of freedom
##   (14 observations deleted due to missingness)
## Multiple R-squared:  0.03843,    Adjusted R-squared:  0.03703 
## F-statistic: 27.54 on 1 and 689 DF,  p-value: 2.055e-07

5.2.2.2 Bike lane / street

Measuring bike lane length change, normalized by length of streets within CT/buffers (in meters)

5.2.2.2.1 Census tract level
ggplot(units::drop_units(bei_df_aoi), aes(x=Bike_lane_diff.by.street.2011.2016ct, y=wSCORESOC.2016)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(wSCORESOC.2016 ~ Bike_lane_diff.by.street.2011.2016ct, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = wSCORESOC.2016 ~ Bike_lane_diff.by.street.2011.2016ct, 
##     data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.073622 -0.020689  0.003123  0.020500  0.092831 
## 
## Coefficients:
##                                       Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                          0.0201386  0.0012150  16.575  < 2e-16 ***
## Bike_lane_diff.by.street.2011.2016ct 0.0008854  0.0001507   5.875 6.57e-09 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.02844 on 689 degrees of freedom
##   (14 observations deleted due to missingness)
## Multiple R-squared:  0.04771,    Adjusted R-squared:  0.04633 
## F-statistic: 34.52 on 1 and 689 DF,  p-value: 6.572e-09
5.2.2.2.2 Buffer 250m
ggplot(units::drop_units(bei_df_aoi), aes(x=Bike_lane_diff.by.street.2011.2016b250, y=wSCORESOC.2016)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(wSCORESOC.2016 ~ Bike_lane_diff.by.street.2011.2016b250, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = wSCORESOC.2016 ~ Bike_lane_diff.by.street.2011.2016b250, 
##     data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.073366 -0.020023  0.003232  0.020039  0.094869 
## 
## Coefficients:
##                                         Estimate Std. Error t value Pr(>|t|)
## (Intercept)                            0.0180999  0.0012572   14.40  < 2e-16
## Bike_lane_diff.by.street.2011.2016b250 0.0015309  0.0001948    7.86 1.48e-14
##                                           
## (Intercept)                            ***
## Bike_lane_diff.by.street.2011.2016b250 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.02792 on 689 degrees of freedom
##   (14 observations deleted due to missingness)
## Multiple R-squared:  0.08229,    Adjusted R-squared:  0.08096 
## F-statistic: 61.78 on 1 and 689 DF,  p-value: 1.479e-14
5.2.2.2.3 Buffer 500m
ggplot(units::drop_units(bei_df_aoi), aes(x=Bike_lane_diff.by.street.2011.2016b500, y=wSCORESOC.2016)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(wSCORESOC.2016 ~ Bike_lane_diff.by.street.2011.2016b500, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = wSCORESOC.2016 ~ Bike_lane_diff.by.street.2011.2016b500, 
##     data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.079373 -0.019433  0.002286  0.019687  0.096237 
## 
## Coefficients:
##                                         Estimate Std. Error t value Pr(>|t|)
## (Intercept)                            0.0167316  0.0013054  12.817   <2e-16
## Bike_lane_diff.by.street.2011.2016b500 0.0019347  0.0002242   8.629   <2e-16
##                                           
## (Intercept)                            ***
## Bike_lane_diff.by.street.2011.2016b500 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.02769 on 689 degrees of freedom
##   (14 observations deleted due to missingness)
## Multiple R-squared:  0.09753,    Adjusted R-squared:  0.09622 
## F-statistic: 74.46 on 1 and 689 DF,  p-value: < 2.2e-16
5.2.2.2.4 Buffer 750m
ggplot(units::drop_units(bei_df_aoi), aes(x=Bike_lane_diff.by.street.2011.2016b750, y=wSCORESOC.2016)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(wSCORESOC.2016 ~ Bike_lane_diff.by.street.2011.2016b750, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = wSCORESOC.2016 ~ Bike_lane_diff.by.street.2011.2016b750, 
##     data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.082775 -0.019116  0.002334  0.019230  0.097355 
## 
## Coefficients:
##                                         Estimate Std. Error t value Pr(>|t|)
## (Intercept)                            0.0156136  0.0013498  11.567   <2e-16
## Bike_lane_diff.by.street.2011.2016b750 0.0022619  0.0002478   9.126   <2e-16
##                                           
## (Intercept)                            ***
## Bike_lane_diff.by.street.2011.2016b750 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.02753 on 689 degrees of freedom
##   (14 observations deleted due to missingness)
## Multiple R-squared:  0.1079, Adjusted R-squared:  0.1066 
## F-statistic: 83.29 on 1 and 689 DF,  p-value: < 2.2e-16

5.2.2.3 Bike lane / area

Measuring bike lane length change, normalized by area within CT/buffers (in meters)

5.2.2.3.1 Census tract level
ggplot(units::drop_units(bei_df_aoi), aes(x=Bike_lane_diff.by.area.2011.2016ct, y=wSCORESOC.2016)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(wSCORESOC.2016 ~ Bike_lane_diff.by.area.2011.2016ct, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = wSCORESOC.2016 ~ Bike_lane_diff.by.area.2011.2016ct, 
##     data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.073236 -0.020515  0.002866  0.020518  0.093217 
## 
## Coefficients:
##                                     Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                        0.0197525  0.0011959  16.517  < 2e-16 ***
## Bike_lane_diff.by.area.2011.2016ct 0.0061132  0.0008897   6.871 1.43e-11 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.0282 on 689 degrees of freedom
##   (14 observations deleted due to missingness)
## Multiple R-squared:  0.06413,    Adjusted R-squared:  0.06277 
## F-statistic: 47.21 on 1 and 689 DF,  p-value: 1.428e-11
5.2.2.3.2 Buffer 250m
ggplot(units::drop_units(bei_df_aoi), aes(x=Bike_lane_diff.by.area.2011.2016b250, y=wSCORESOC.2016)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(wSCORESOC.2016 ~ Bike_lane_diff.by.area.2011.2016b250, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = wSCORESOC.2016 ~ Bike_lane_diff.by.area.2011.2016b250, 
##     data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.071159 -0.019660  0.002669  0.019434  0.095294 
## 
## Coefficients:
##                                      Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                          0.017675   0.001220  14.483   <2e-16 ***
## Bike_lane_diff.by.area.2011.2016b250 0.010228   0.001122   9.117   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.02753 on 689 degrees of freedom
##   (14 observations deleted due to missingness)
## Multiple R-squared:  0.1077, Adjusted R-squared:  0.1064 
## F-statistic: 83.12 on 1 and 689 DF,  p-value: < 2.2e-16
5.2.2.3.3 Buffer 500m
ggplot(units::drop_units(bei_df_aoi), aes(x=Bike_lane_diff.by.area.2011.2016b500, y=wSCORESOC.2016)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(wSCORESOC.2016 ~ Bike_lane_diff.by.area.2011.2016b500, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = wSCORESOC.2016 ~ Bike_lane_diff.by.area.2011.2016b500, 
##     data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.073323 -0.018545  0.000951  0.019280  0.096782 
## 
## Coefficients:
##                                      Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                          0.016187   0.001251   12.94   <2e-16 ***
## Bike_lane_diff.by.area.2011.2016b500 0.013362   0.001309   10.21   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.02716 on 689 degrees of freedom
##   (14 observations deleted due to missingness)
## Multiple R-squared:  0.1314, Adjusted R-squared:  0.1301 
## F-statistic: 104.2 on 1 and 689 DF,  p-value: < 2.2e-16
5.2.2.3.4 Buffer 750m
ggplot(units::drop_units(bei_df_aoi), aes(x=Bike_lane_diff.by.area.2011.2016b750, y=wSCORESOC.2016)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(wSCORESOC.2016 ~ Bike_lane_diff.by.area.2011.2016b750, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = wSCORESOC.2016 ~ Bike_lane_diff.by.area.2011.2016b750, 
##     data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.072996 -0.018383  0.001469  0.018820  0.097856 
## 
## Coefficients:
##                                      Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                          0.015113   0.001275   11.85   <2e-16 ***
## Bike_lane_diff.by.area.2011.2016b750 0.015657   0.001439   10.88   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.02692 on 689 degrees of freedom
##   (14 observations deleted due to missingness)
## Multiple R-squared:  0.1467, Adjusted R-squared:  0.1455 
## F-statistic: 118.4 on 1 and 689 DF,  p-value: < 2.2e-16

5.2.2.4 Canopy change

Measuring canopy (i.e. greenness) ratio change within CT/buffer between 2011 and 2017 (in %)

5.2.2.4.1 Census tract level
ggplot(units::drop_units(bei_df_aoi), aes(x=pct_esp_vert_diff_2011.2017ct, y=wSCORESOC.2016)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(wSCORESOC.2016 ~ pct_esp_vert_diff_2011.2017ct, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = wSCORESOC.2016 ~ pct_esp_vert_diff_2011.2017ct, 
##     data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.074002 -0.020739  0.002973  0.021949  0.092434 
## 
## Coefficients:
##                                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                   0.0164107  0.0017116   9.588  < 2e-16 ***
## pct_esp_vert_diff_2011.2017ct 0.0016766  0.0003178   5.276 1.77e-07 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.02857 on 689 degrees of freedom
##   (14 observations deleted due to missingness)
## Multiple R-squared:  0.03883,    Adjusted R-squared:  0.03743 
## F-statistic: 27.83 on 1 and 689 DF,  p-value: 1.772e-07
5.2.2.4.2 Buffer 250m
ggplot(units::drop_units(bei_df_aoi), aes(x=pct_esp_vert_diff_2011.2017b250, y=wSCORESOC.2016)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(wSCORESOC.2016 ~ pct_esp_vert_diff_2011.2017b250, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = wSCORESOC.2016 ~ pct_esp_vert_diff_2011.2017b250, 
##     data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.088141 -0.019980  0.003517  0.021584  0.089886 
## 
## Coefficients:
##                                  Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                     0.0143620  0.0018133   7.920 9.50e-15 ***
## pct_esp_vert_diff_2011.2017b250 0.0022831  0.0003687   6.193 1.02e-09 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.02837 on 689 degrees of freedom
##   (14 observations deleted due to missingness)
## Multiple R-squared:  0.05272,    Adjusted R-squared:  0.05135 
## F-statistic: 38.35 on 1 and 689 DF,  p-value: 1.017e-09
5.2.2.4.3 Buffer 500m
ggplot(units::drop_units(bei_df_aoi), aes(x=pct_esp_vert_diff_2011.2017b500, y=wSCORESOC.2016)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(wSCORESOC.2016 ~ pct_esp_vert_diff_2011.2017b500, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = wSCORESOC.2016 ~ pct_esp_vert_diff_2011.2017b500, 
##     data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.088327 -0.020377  0.003395  0.021423  0.088250 
## 
## Coefficients:
##                                  Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                     0.0137482  0.0018787   7.318 7.02e-13 ***
## pct_esp_vert_diff_2011.2017b500 0.0024765  0.0003953   6.265 6.56e-10 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.02835 on 689 degrees of freedom
##   (14 observations deleted due to missingness)
## Multiple R-squared:  0.0539, Adjusted R-squared:  0.05253 
## F-statistic: 39.25 on 1 and 689 DF,  p-value: 6.556e-10
5.2.2.4.4 Buffer 750m
ggplot(units::drop_units(bei_df_aoi), aes(x=pct_esp_vert_diff_2011.2017b750, y=wSCORESOC.2016)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(wSCORESOC.2016 ~ pct_esp_vert_diff_2011.2017b750, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = wSCORESOC.2016 ~ pct_esp_vert_diff_2011.2017b750, 
##     data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.081951 -0.019840  0.003141  0.021681  0.088200 
## 
## Coefficients:
##                                  Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                     0.0137891  0.0019140   7.204 1.53e-12 ***
## pct_esp_vert_diff_2011.2017b750 0.0025011  0.0004118   6.074 2.07e-09 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.0284 on 689 degrees of freedom
##   (14 observations deleted due to missingness)
## Multiple R-squared:  0.05082,    Adjusted R-squared:  0.04944 
## F-statistic: 36.89 on 1 and 689 DF,  p-value: 2.066e-09

5.2.3 Gentrified CT | 2016

5.2.3.1 Bike lane length

Measuring bike lane length change within CT/buffers (in meters) between 2011 and 2016

5.2.3.1.1 Census tract level
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2016_2011), aes(x=Bike_lane_diff.2011.2016ct, y=gentrified_2016_2011)) +
  geom_boxplot()

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(Bike_lane_diff.2011.2016ct, na.rm = TRUE),
    sd = sd(Bike_lane_diff.2011.2016ct, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(Bike_lane_diff.2011.2016ct ~ gentrified_2016_2011, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df    Sum Sq Mean Sq F value Pr(>F)
## gentrified_2016_2011   1   1115825 1115825   1.038  0.309
## Residuals            688 739651503 1075075               
## 15 observations deleted due to missingness
5.2.3.1.2 Buffers 250m
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2016_2011), aes(x=Bike_lane_diff.2011.2016b250, y=gentrified_2016_2011)) +
  geom_boxplot()

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(Bike_lane_diff.2011.2016b250, na.rm = TRUE),
    sd = sd(Bike_lane_diff.2011.2016b250, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(Bike_lane_diff.2011.2016b250 ~ gentrified_2016_2011, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df    Sum Sq Mean Sq F value Pr(>F)
## gentrified_2016_2011   1 4.340e+06 4340160    1.56  0.212
## Residuals            688 1.914e+09 2781403               
## 15 observations deleted due to missingness
5.2.3.1.3 Buffers 500m
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2016_2011), aes(x=Bike_lane_diff.2011.2016b500, y=gentrified_2016_2011)) +
  geom_boxplot()

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(Bike_lane_diff.2011.2016b500, na.rm = TRUE),
    sd = sd(Bike_lane_diff.2011.2016b500, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(Bike_lane_diff.2011.2016b500 ~ gentrified_2016_2011, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df    Sum Sq  Mean Sq F value  Pr(>F)   
## gentrified_2016_2011   1 4.732e+07 47317317   8.356 0.00396 **
## Residuals            688 3.896e+09  5662417                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 15 observations deleted due to missingness
5.2.3.1.4 Buffers 750m
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2016_2011), aes(x=Bike_lane_diff.2011.2016b750, y=gentrified_2016_2011)) +
  geom_boxplot()

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(Bike_lane_diff.2011.2016b750, na.rm = TRUE),
    sd = sd(Bike_lane_diff.2011.2016b750, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(Bike_lane_diff.2011.2016b750 ~ gentrified_2016_2011, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df    Sum Sq   Mean Sq F value   Pr(>F)    
## gentrified_2016_2011   1 1.527e+08 152740935   14.75 0.000134 ***
## Residuals            688 7.125e+09  10356102                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 15 observations deleted due to missingness

5.2.3.2 Bike lane / street

Measuring bike lane length change, normalized by length of streets within CT/buffers (in meters)

5.2.3.2.1 Census tract level
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2016_2011), aes(x=Bike_lane_diff.by.street.2011.2016ct, y=gentrified_2016_2011)) +
  geom_boxplot()

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(Bike_lane_diff.by.street.2011.2016ct, na.rm = TRUE),
    sd = sd(Bike_lane_diff.by.street.2011.2016ct, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(Bike_lane_diff.by.street.2011.2016ct ~ gentrified_2016_2011, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value   Pr(>F)    
## gentrified_2016_2011   1    843   843.4   16.69 4.92e-05 ***
## Residuals            688  34767    50.5                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 15 observations deleted due to missingness
5.2.3.2.2 Buffers 250m
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2016_2011), aes(x=Bike_lane_diff.by.street.2011.2016b250, y=gentrified_2016_2011)) +
  geom_boxplot()

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(Bike_lane_diff.by.street.2011.2016b250, na.rm = TRUE),
    sd = sd(Bike_lane_diff.by.street.2011.2016b250, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(Bike_lane_diff.by.street.2011.2016b250 ~ gentrified_2016_2011, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value   Pr(>F)    
## gentrified_2016_2011   1   1124  1123.9    39.8 5.03e-10 ***
## Residuals            688  19426    28.2                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 15 observations deleted due to missingness
5.2.3.2.3 Buffers 500m
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2016_2011), aes(x=Bike_lane_diff.by.street.2011.2016b500, y=gentrified_2016_2011)) +
  geom_boxplot()

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(Bike_lane_diff.by.street.2011.2016b500, na.rm = TRUE),
    sd = sd(Bike_lane_diff.by.street.2011.2016b500, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(Bike_lane_diff.by.street.2011.2016b500 ~ gentrified_2016_2011, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value   Pr(>F)    
## gentrified_2016_2011   1    965   965.1    46.5 2.01e-11 ***
## Residuals            688  14280    20.8                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 15 observations deleted due to missingness
5.2.3.2.4 Buffers 750m
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2016_2011), aes(x=Bike_lane_diff.by.street.2011.2016b750, y=gentrified_2016_2011)) +
  geom_boxplot()

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(Bike_lane_diff.by.street.2011.2016b750, na.rm = TRUE),
    sd = sd(Bike_lane_diff.by.street.2011.2016b750, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(Bike_lane_diff.by.street.2011.2016b750 ~ gentrified_2016_2011, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value   Pr(>F)    
## gentrified_2016_2011   1    759   758.6   45.14 3.85e-11 ***
## Residuals            688  11563    16.8                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 15 observations deleted due to missingness

5.2.3.3 Bike lane / area

Measuring bike lane length change, normalized by area within CT/buffers (in meters)

5.2.3.3.1 Census tract level
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2016_2011), aes(x=Bike_lane_diff.by.area.2011.2016ct, y=gentrified_2016_2011)) +
  geom_boxplot()

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(Bike_lane_diff.by.area.2011.2016ct, na.rm = TRUE),
    sd = sd(Bike_lane_diff.by.area.2011.2016ct, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(Bike_lane_diff.by.area.2011.2016ct ~ gentrified_2016_2011, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value   Pr(>F)    
## gentrified_2016_2011   1   34.5   34.48   24.46 9.52e-07 ***
## Residuals            688  969.5    1.41                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 15 observations deleted due to missingness
5.2.3.3.2 Buffers 250m
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2016_2011), aes(x=Bike_lane_diff.by.area.2011.2016b250, y=gentrified_2016_2011)) +
  geom_boxplot()

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(Bike_lane_diff.by.area.2011.2016b250, na.rm = TRUE),
    sd = sd(Bike_lane_diff.by.area.2011.2016b250, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(Bike_lane_diff.by.area.2011.2016b250 ~ gentrified_2016_2011, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value   Pr(>F)    
## gentrified_2016_2011   1   41.2   41.17   50.48 3.01e-12 ***
## Residuals            688  561.1    0.82                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 15 observations deleted due to missingness
5.2.3.3.3 Buffers 500m
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2016_2011), aes(x=Bike_lane_diff.by.area.2011.2016b500, y=gentrified_2016_2011)) +
  geom_boxplot()

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(Bike_lane_diff.by.area.2011.2016b500, na.rm = TRUE),
    sd = sd(Bike_lane_diff.by.area.2011.2016b500, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(Bike_lane_diff.by.area.2011.2016b500 ~ gentrified_2016_2011, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value   Pr(>F)    
## gentrified_2016_2011   1   35.4   35.39   61.66 1.57e-14 ***
## Residuals            688  394.9    0.57                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 15 observations deleted due to missingness
5.2.3.3.4 Buffers 750m
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2016_2011), aes(x=Bike_lane_diff.by.area.2011.2016b750, y=gentrified_2016_2011)) +
  geom_boxplot()

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(Bike_lane_diff.by.area.2011.2016b750, na.rm = TRUE),
    sd = sd(Bike_lane_diff.by.area.2011.2016b750, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(Bike_lane_diff.by.area.2011.2016b750 ~ gentrified_2016_2011, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value   Pr(>F)    
## gentrified_2016_2011   1   28.1  28.072   60.08 3.28e-14 ***
## Residuals            688  321.5   0.467                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 15 observations deleted due to missingness

5.2.3.4 Canopy change

5.2.3.4.1 Census tract level
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2016_2011), aes(x=pct_esp_vert_diff_2011.2017ct, y=gentrified_2016_2011)) +
  geom_boxplot() 

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_diff_2011.2017ct, na.rm = TRUE),
    sd = sd(pct_esp_vert_diff_2011.2017ct, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_diff_2011.2017ct ~ gentrified_2016_2011, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value  Pr(>F)   
## gentrified_2016_2011   1     97   96.85   8.355 0.00397 **
## Residuals            688   7975   11.59                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 15 observations deleted due to missingness
5.2.3.4.2 Buffer 250m
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2016_2011), aes(x=pct_esp_vert_diff_2011.2017b250, y=gentrified_2016_2011)) +
  geom_boxplot() 

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_diff_2011.2017b250, na.rm = TRUE),
    sd = sd(pct_esp_vert_diff_2011.2017b250, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_diff_2011.2017b250 ~ gentrified_2016_2011, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value Pr(>F)  
## gentrified_2016_2011   1     57   56.50   6.639 0.0102 *
## Residuals            688   5855    8.51                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 15 observations deleted due to missingness
5.2.3.4.3 Buffer 500m
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2016_2011), aes(x=pct_esp_vert_diff_2011.2017b500, y=gentrified_2016_2011)) +
  geom_boxplot() 

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_diff_2011.2017b500, na.rm = TRUE),
    sd = sd(pct_esp_vert_diff_2011.2017b500, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_diff_2011.2017b500 ~ gentrified_2016_2011, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value Pr(>F)   
## gentrified_2016_2011   1     59   58.84   7.967 0.0049 **
## Residuals            688   5081    7.39                  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 15 observations deleted due to missingness
5.2.3.4.4 Buffer 750m
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2016_2011), aes(x=pct_esp_vert_diff_2011.2017b750, y=gentrified_2016_2011)) +
  geom_boxplot() 

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_diff_2011.2017b750, na.rm = TRUE),
    sd = sd(pct_esp_vert_diff_2011.2017b750, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_diff_2011.2017b750 ~ gentrified_2016_2011, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value  Pr(>F)   
## gentrified_2016_2011   1     53   53.32   7.808 0.00535 **
## Residuals            688   4699    6.83                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 15 observations deleted due to missingness

5.2.4 Gentrified CT | 2011

5.2.4.1 Bike lane length

Measuring bike lane length change within CT/buffers (in meters) between 2011 and 2016 (and not between 2006 and 2011)

5.2.4.1.1 Census tract level
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2011_2006), aes(x=Bike_lane_diff.2011.2016ct, y=gentrified_2011_2006)) +
  geom_boxplot() 

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2011_2006) %>%
  summarise(
    count = n(),
    mean = mean(Bike_lane_diff.2011.2016ct, na.rm = TRUE),
    sd = sd(Bike_lane_diff.2011.2016ct, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(Bike_lane_diff.2011.2016ct ~ gentrified_2011_2006, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df    Sum Sq Mean Sq F value Pr(>F)
## gentrified_2011_2006   1    227980  227980   0.208  0.648
## Residuals            674 738566819 1095796               
## 29 observations deleted due to missingness
5.2.4.1.2 Buffers 250m
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2011_2006), aes(x=Bike_lane_diff.2011.2016b250, y=gentrified_2011_2006)) +
  geom_boxplot()

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2011_2006) %>%
  summarise(
    count = n(),
    mean = mean(Bike_lane_diff.2011.2016b250, na.rm = TRUE),
    sd = sd(Bike_lane_diff.2011.2016b250, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(Bike_lane_diff.2011.2016b250 ~ gentrified_2011_2006, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df    Sum Sq  Mean Sq F value Pr(>F)  
## gentrified_2011_2006   1 1.097e+07 10973598   3.898 0.0487 *
## Residuals            674 1.897e+09  2815091                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 29 observations deleted due to missingness
5.2.4.1.3 Buffers 500m
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2011_2006), aes(x=Bike_lane_diff.2011.2016b500, y=gentrified_2011_2006)) +
  geom_boxplot()

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2011_2006) %>%
  summarise(
    count = n(),
    mean = mean(Bike_lane_diff.2011.2016b500, na.rm = TRUE),
    sd = sd(Bike_lane_diff.2011.2016b500, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(Bike_lane_diff.2011.2016b500 ~ gentrified_2011_2006, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df    Sum Sq  Mean Sq F value  Pr(>F)   
## gentrified_2011_2006   1 6.005e+07 60051961   10.51 0.00125 **
## Residuals            674 3.852e+09  5715401                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 29 observations deleted due to missingness
5.2.4.1.4 Buffers 750m
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2011_2006), aes(x=Bike_lane_diff.2011.2016b750, y=gentrified_2011_2006)) +
  geom_boxplot()

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2011_2006) %>%
  summarise(
    count = n(),
    mean = mean(Bike_lane_diff.2011.2016b750, na.rm = TRUE),
    sd = sd(Bike_lane_diff.2011.2016b750, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(Bike_lane_diff.2011.2016b750 ~ gentrified_2011_2006, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df    Sum Sq   Mean Sq F value   Pr(>F)    
## gentrified_2011_2006   1 2.429e+08 242939736   23.52 1.54e-06 ***
## Residuals            674 6.962e+09  10329115                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 29 observations deleted due to missingness

5.2.4.2 Canopy change

5.2.4.2.1 Census tract level
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2011_2006), aes(x=pct_esp_vert_diff_2011.2017ct, y=gentrified_2011_2006)) +
  geom_boxplot() 

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2011_2006) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_diff_2011.2017ct, na.rm = TRUE),
    sd = sd(pct_esp_vert_diff_2011.2017ct, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_diff_2011.2017ct ~ gentrified_2011_2006, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value Pr(>F)  
## gentrified_2011_2006   1     62   61.93   5.247 0.0223 *
## Residuals            674   7955   11.80                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 29 observations deleted due to missingness
5.2.4.2.2 Buffer 250m
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2011_2006), aes(x=pct_esp_vert_diff_2011.2017b250, y=gentrified_2011_2006)) +
  geom_boxplot() 

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2011_2006) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_diff_2011.2017b250, na.rm = TRUE),
    sd = sd(pct_esp_vert_diff_2011.2017b250, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_diff_2011.2017b250 ~ gentrified_2011_2006, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value  Pr(>F)   
## gentrified_2011_2006   1     71   71.25   8.247 0.00421 **
## Residuals            674   5823    8.64                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 29 observations deleted due to missingness
5.2.4.2.3 Buffer 500m
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2011_2006), aes(x=pct_esp_vert_diff_2011.2017b500, y=gentrified_2011_2006)) +
  geom_boxplot() 

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2011_2006) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_diff_2011.2017b500, na.rm = TRUE),
    sd = sd(pct_esp_vert_diff_2011.2017b500, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_diff_2011.2017b500 ~ gentrified_2011_2006, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value  Pr(>F)   
## gentrified_2011_2006   1     61   61.45   8.204 0.00431 **
## Residuals            674   5048    7.49                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 29 observations deleted due to missingness
5.2.4.2.4 Buffer 750m
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2011_2006), aes(x=pct_esp_vert_diff_2011.2017b750, y=gentrified_2011_2006)) +
  geom_boxplot() 

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2011_2006) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_diff_2011.2017b750, na.rm = TRUE),
    sd = sd(pct_esp_vert_diff_2011.2017b750, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_diff_2011.2017b750 ~ gentrified_2011_2006, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value  Pr(>F)   
## gentrified_2011_2006   1     55   54.67   7.887 0.00512 **
## Residuals            674   4672    6.93                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 29 observations deleted due to missingness

5.2.5 Gentrified CT | 2006

5.2.5.1 Bike lane length

Measuring bike lane length change within CT/buffers (in meters) between 2011 and 2016 (and not between 2001 and 2006)

5.2.5.1.1 Census tract level
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2006_2001), aes(x=Bike_lane_diff.2011.2016ct, y=gentrified_2006_2001)) +
  geom_boxplot() 

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2006_2001) %>%
  summarise(
    count = n(),
    mean = mean(Bike_lane_diff.2011.2016ct, na.rm = TRUE),
    sd = sd(Bike_lane_diff.2011.2016ct, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(Bike_lane_diff.2011.2016ct ~ gentrified_2006_2001, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df    Sum Sq Mean Sq F value Pr(>F)
## gentrified_2006_2001   1     27515   27515    0.05  0.824
## Residuals            634 351091051  553771               
## 69 observations deleted due to missingness
5.2.5.1.2 Buffers 250m
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2006_2001), aes(x=Bike_lane_diff.2011.2016b250, y=gentrified_2006_2001)) +
  geom_boxplot()

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2006_2001) %>%
  summarise(
    count = n(),
    mean = mean(Bike_lane_diff.2011.2016b250, na.rm = TRUE),
    sd = sd(Bike_lane_diff.2011.2016b250, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(Bike_lane_diff.2011.2016b250 ~ gentrified_2006_2001, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df    Sum Sq  Mean Sq F value  Pr(>F)    
## gentrified_2006_2001   1 2.192e+07 21920663   13.42 0.00027 ***
## Residuals            634 1.036e+09  1633304                    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 69 observations deleted due to missingness
5.2.5.1.3 Buffers 500m
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2006_2001), aes(x=Bike_lane_diff.2011.2016b500, y=gentrified_2006_2001)) +
  geom_boxplot()

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2006_2001) %>%
  summarise(
    count = n(),
    mean = mean(Bike_lane_diff.2011.2016b500, na.rm = TRUE),
    sd = sd(Bike_lane_diff.2011.2016b500, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(Bike_lane_diff.2011.2016b500 ~ gentrified_2006_2001, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df    Sum Sq   Mean Sq F value   Pr(>F)    
## gentrified_2006_2001   1 1.139e+08 113920313   28.58 1.25e-07 ***
## Residuals            634 2.527e+09   3985549                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 69 observations deleted due to missingness
5.2.5.1.4 Buffers 750m
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2006_2001), aes(x=Bike_lane_diff.2011.2016b750, y=gentrified_2006_2001)) +
  geom_boxplot()

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2006_2001) %>%
  summarise(
    count = n(),
    mean = mean(Bike_lane_diff.2011.2016b750, na.rm = TRUE),
    sd = sd(Bike_lane_diff.2011.2016b750, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(Bike_lane_diff.2011.2016b750 ~ gentrified_2006_2001, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df    Sum Sq   Mean Sq F value  Pr(>F)    
## gentrified_2006_2001   1 3.754e+08 375368237   46.86 1.8e-11 ***
## Residuals            634 5.079e+09   8010555                    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 69 observations deleted due to missingness

5.2.5.2 Canopy change

5.2.5.2.1 Census tract level
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2006_2001), aes(x=pct_esp_vert_diff_2011.2017ct, y=gentrified_2006_2001)) +
  geom_boxplot() 

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2006_2001) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_diff_2011.2017ct, na.rm = TRUE),
    sd = sd(pct_esp_vert_diff_2011.2017ct, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_diff_2011.2017ct ~ gentrified_2006_2001, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value   Pr(>F)    
## gentrified_2006_2001   1    173  172.53   16.48 5.52e-05 ***
## Residuals            634   6635   10.47                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 69 observations deleted due to missingness
5.2.5.2.2 Buffer 250m
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2006_2001), aes(x=pct_esp_vert_diff_2011.2017b250, y=gentrified_2006_2001)) +
  geom_boxplot() 

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2006_2001) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_diff_2011.2017b250, na.rm = TRUE),
    sd = sd(pct_esp_vert_diff_2011.2017b250, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_diff_2011.2017b250 ~ gentrified_2006_2001, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value   Pr(>F)    
## gentrified_2006_2001   1    170  170.16   22.26 2.93e-06 ***
## Residuals            634   4847    7.64                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 69 observations deleted due to missingness
5.2.5.2.3 Buffer 500m
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2006_2001), aes(x=pct_esp_vert_diff_2011.2017b500, y=gentrified_2006_2001)) +
  geom_boxplot() 

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2006_2001) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_diff_2011.2017b500, na.rm = TRUE),
    sd = sd(pct_esp_vert_diff_2011.2017b500, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_diff_2011.2017b500 ~ gentrified_2006_2001, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value   Pr(>F)    
## gentrified_2006_2001   1    150  150.20   22.59 2.48e-06 ***
## Residuals            634   4216    6.65                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 69 observations deleted due to missingness
5.2.5.2.4 Buffer 750m
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2006_2001), aes(x=pct_esp_vert_diff_2011.2017b750, y=gentrified_2006_2001)) +
  geom_boxplot() 

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2006_2001) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_diff_2011.2017b750, na.rm = TRUE),
    sd = sd(pct_esp_vert_diff_2011.2017b750, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_diff_2011.2017b750 ~ gentrified_2006_2001, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value   Pr(>F)    
## gentrified_2006_2001   1    121  120.76   19.42 1.23e-05 ***
## Residuals            634   3942    6.22                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 69 observations deleted due to missingness